
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta charset="utf-8" />
    <title>Classes and functions &#8212; Spatial Maths package 0.7.0
 documentation</title>
    <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <link rel="stylesheet" type="text/css" href="_static/graphviz.css" />
    <script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
    <script src="_static/jquery.js"></script>
    <script src="_static/underscore.js"></script>
    <script src="_static/doctools.js"></script>
    <script src="_static/language_data.js"></script>
    <script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Indices" href="indices.html" />
    <link rel="prev" title="Introduction" href="intro.html" />
   
  <link rel="stylesheet" href="_static/custom.css" type="text/css" />
  
  
  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />

  </head><body>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          

          <div class="body" role="main">
            
  <div class="section" id="classes-and-functions">
<h1>Classes and functions<a class="headerlink" href="#classes-and-functions" title="Permalink to this headline">¶</a></h1>
<div class="section" id="pose-classes">
<h2>Pose classes<a class="headerlink" href="#pose-classes" title="Permalink to this headline">¶</a></h2>
<div class="section" id="module-spatialmath.pose2d">
<span id="pose-in-2d"></span><h3>Pose in 2D<a class="headerlink" href="#module-spatialmath.pose2d" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="spatialmath.pose2d.SO2">
<em class="property">class </em><code class="sig-prename descclassname">spatialmath.pose2d.</code><code class="sig-name descname">SO2</code><span class="sig-paren">(</span><em class="sig-param">arg=None</em>, <em class="sig-param">*</em>, <em class="sig-param">unit='rad'</em>, <em class="sig-param">check=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose2d.html#SO2"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose2d.SO2" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">spatialmath.super_pose.SMPose</span></code></p>
<dl class="method">
<dt id="spatialmath.pose2d.SO2.__init__">
<code class="sig-name descname">__init__</code><span class="sig-paren">(</span><em class="sig-param">arg=None</em>, <em class="sig-param">*</em>, <em class="sig-param">unit='rad'</em>, <em class="sig-param">check=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose2d.html#SO2.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose2d.SO2.__init__" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct new SO(2) object</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>unit</strong> (<em>str</em><em>, </em><em>optional</em>) – angular units ‘deg’ or ‘rad’ [default] if applicable</p></li>
<li><p><strong>check</strong> (<em>bool</em>) – check for valid SO(2) elements if applicable, default to True</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>SO(2) rotation</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>SO2 instance</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">SO2()</span></code> is an SO2 instance representing a null rotation – the identity matrix.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SO2(theta)</span></code> is an SO2 instance representing a rotation by <code class="docutils literal notranslate"><span class="pre">theta</span></code> radians.  If <code class="docutils literal notranslate"><span class="pre">theta</span></code> is array_like
<cite>[theta1, theta2, … thetaN]</cite> then an SO2 instance containing a sequence of N rotations.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SO2(theta,</span> <span class="pre">unit='deg')</span></code> is an SO2 instance representing a rotation by <code class="docutils literal notranslate"><span class="pre">theta</span></code> degrees.  If <code class="docutils literal notranslate"><span class="pre">theta</span></code> is array_like
<cite>[theta1, theta2, … thetaN]</cite> then an SO2 instance containing a sequence of N rotations.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SO2(R)</span></code> is an SO2 instance with rotation described by the SO(2) matrix R which is a 2x2 numpy array.  If <code class="docutils literal notranslate"><span class="pre">check</span></code>
is <code class="docutils literal notranslate"><span class="pre">True</span></code> check the matrix belongs to SO(2).</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SO2([R1,</span> <span class="pre">R2,</span> <span class="pre">...</span> <span class="pre">RN])</span></code> is an SO2 instance containing a sequence of N rotations, each described by an SO(2) matrix
Ri which is a 2x2 numpy array. If <code class="docutils literal notranslate"><span class="pre">check</span></code> is <code class="docutils literal notranslate"><span class="pre">True</span></code> then check each matrix belongs to SO(2).</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SO2([X1,</span> <span class="pre">X2,</span> <span class="pre">...</span> <span class="pre">XN])</span></code> is an SO2 instance containing a sequence of N rotations, where each Xi is an SO2 instance.</p></li>
</ul>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.Rand">
<em class="property">classmethod </em><code class="sig-name descname">Rand</code><span class="sig-paren">(</span><em class="sig-param">*, range=[0, 6.283185307179586], unit='rad', N=1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose2d.html#SO2.Rand"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose2d.SO2.Rand" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct new SO(2) with random rotation</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>range</strong> (<em>2-element array-like</em><em>, </em><em>optional</em>) – rotation range, defaults to <span class="math notranslate nohighlight">\([0, 2\pi)\)</span>.</p></li>
<li><p><strong>unit</strong> (<em>str</em><em>, </em><em>optional</em>) – angular units as ‘deg or ‘rad’ [default]</p></li>
<li><p><strong>N</strong> (<em>int</em>) – number of random rotations, defaults to 1</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>SO(2) rotation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>SO2 instance</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">SO2.Rand()</span></code> is a random SO(2) rotation.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SO2.Rand([-90,</span> <span class="pre">90],</span> <span class="pre">unit='deg')</span></code> is a random SO(2) rotation between 
-90 and +90 degrees.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SO2.Rand(N)</span></code> is a sequence of N random rotations.</p></li>
</ul>
<p>Rotations are uniform over the specified interval.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.Exp">
<em class="property">classmethod </em><code class="sig-name descname">Exp</code><span class="sig-paren">(</span><em class="sig-param">S</em>, <em class="sig-param">check=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose2d.html#SO2.Exp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose2d.SO2.Exp" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct new SO(2) rotation matrix from so(2) Lie algebra</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>S</strong> (<em>numpy ndarray</em>) – element of Lie algebra so(2)</p></li>
<li><p><strong>check</strong> (<em>bool</em>) – check that passed matrix is valid so(2), default True</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>SO(2) rotation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>SO2 instance</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">SO2.Exp(S)</span></code> is an SO(2) rotation defined by its Lie algebra
which is a 2x2 so(2) matrix (skew symmetric)</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><code class="xref py py-func docutils literal notranslate"><span class="pre">spatialmath.base.transforms2d.trexp()</span></code>, <a class="reference internal" href="#spatialmath.base.transformsNd.skew" title="spatialmath.base.transformsNd.skew"><code class="xref py py-func docutils literal notranslate"><span class="pre">spatialmath.base.transformsNd.skew()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.isvalid">
<em class="property">static </em><code class="sig-name descname">isvalid</code><span class="sig-paren">(</span><em class="sig-param">x</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose2d.html#SO2.isvalid"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose2d.SO2.isvalid" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if matrix is valid SO(2)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>x</strong> (<em>numpy.ndarray</em>) – matrix to test</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>True if the matrix is a valid element of SO(2), ie. it is a 2x2
orthonormal matrix with determinant of +1.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
<dt class="field-even">Seealso</dt>
<dd class="field-even"><p><code class="xref py py-func docutils literal notranslate"><span class="pre">isrot()</span></code></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.inv">
<code class="sig-name descname">inv</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose2d.html#SO2.inv"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose2d.SO2.inv" title="Permalink to this definition">¶</a></dt>
<dd><p>Inverse of SO(2)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>inverse rotation</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>SO2 instance</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">x.inv()</span></code> is the inverse of <cite>x</cite>.</p></li>
</ul>
<p>Notes:</p>
<blockquote>
<div><ul class="simple">
<li><p>for elements of SO(2) this is the transpose.</p></li>
<li><p>if <cite>x</cite> contains a sequence, returns an <cite>SO2</cite> with a sequence of inverses</p></li>
</ul>
</div></blockquote>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.R">
<em class="property">property </em><code class="sig-name descname">R</code><a class="headerlink" href="#spatialmath.pose2d.SO2.R" title="Permalink to this definition">¶</a></dt>
<dd><p>SO(2) or SE(2) as rotation matrix</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>rotational component</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>numpy.ndarray, shape=(2,2)</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">x.R</span></code> returns the rotation matrix, when <cite>x</cite> is <cite>SO2</cite> or <cite>SE2</cite>. If <cite>len(x)</cite> is:</p>
<ul class="simple">
<li><p>1, return an ndarray with shape=(2,2)</p></li>
<li><p>N&gt;1, return ndarray with shape=(N,2,2)</p></li>
</ul>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.theta">
<code class="sig-name descname">theta</code><span class="sig-paren">(</span><em class="sig-param">units='rad'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose2d.html#SO2.theta"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose2d.SO2.theta" title="Permalink to this definition">¶</a></dt>
<dd><p>SO(2) as a rotation angle</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>unit</strong> (<em>str</em><em>, </em><em>optional</em>) – angular units ‘deg’ or ‘rad’ [default]</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>rotation angle</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>float or list</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">x.theta</span></code> is the rotation angle such that <cite>x</cite> is <cite>SO2(x.theta)</cite>.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.SE2">
<code class="sig-name descname">SE2</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose2d.html#SO2.SE2"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose2d.SO2.SE2" title="Permalink to this definition">¶</a></dt>
<dd><p>Create SE(2) from SO(2)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>SE(2) with same rotation but zero translation</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>SE2 instance</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.A">
<em class="property">property </em><code class="sig-name descname">A</code><a class="headerlink" href="#spatialmath.pose2d.SO2.A" title="Permalink to this definition">¶</a></dt>
<dd><p>Interal array representation (superclass property)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>self</strong> (<a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2"><em>SO2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><em>SE2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3"><em>SO3</em></a><em>, </em><em>SE3 instance</em>) – the pose object</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The numeric array</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray</p>
</dd>
</dl>
<p>Each pose subclass SO(N) or SE(N) are stored internally as a numpy array. This property returns
the array, shape depends on the particular subclass.</p>
<p>Examples:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">A</span>
<span class="go">array([[1., 0., 0., 0.],</span>
<span class="go">       [0., 1., 0., 0.],</span>
<span class="go">       [0., 0., 1., 0.],</span>
<span class="go">       [0., 0., 0., 1.]])</span>
</pre></div>
</div>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><cite>shape</cite>, <cite>N</cite></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.Empty">
<em class="property">classmethod </em><code class="sig-name descname">Empty</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SO2.Empty" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct a new pose object with zero items (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>cls</strong> (<a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2"><em>SO2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><em>SE2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3"><em>SO3</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SE3" title="spatialmath.pose3d.SE3"><em>SE3</em></a>) – The pose subclass</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>a pose with zero values</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2">SO2</a>, <a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2">SE2</a>, <a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3">SO3</a>, SE3 instance</p>
</dd>
</dl>
<p>This constructs an empty pose container which can be appended to.  For example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SO2</span><span class="o">.</span><span class="n">Empty</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">SO2</span><span class="p">(</span><span class="mi">20</span><span class="p">,</span> <span class="s1">&#39;deg&#39;</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">1</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.N">
<em class="property">property </em><code class="sig-name descname">N</code><a class="headerlink" href="#spatialmath.pose2d.SO2.N" title="Permalink to this definition">¶</a></dt>
<dd><p>Dimension of the object’s group (superclass property)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>dimension</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>int</p>
</dd>
</dl>
<p>Dimension of the group is 2 for <code class="docutils literal notranslate"><span class="pre">SO2</span></code> or <code class="docutils literal notranslate"><span class="pre">SE2</span></code>, and 3 for <code class="docutils literal notranslate"><span class="pre">SO3</span></code> or <code class="docutils literal notranslate"><span class="pre">SE3</span></code>.
This corresponds to the dimension of the space, 2D or 3D, to which these
rotations or rigid-body motions apply.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">N</span>
<span class="go">3</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.__add__">
<code class="sig-name descname">__add__</code><span class="sig-paren">(</span><em class="sig-param">right</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SO2.__add__" title="Permalink to this definition">¶</a></dt>
<dd><p>Overloaded <code class="docutils literal notranslate"><span class="pre">+</span></code> operator (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>left</strong> – left addend</p></li>
<li><p><strong>right</strong> – right addend</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>sum</p>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><strong>ValueError</strong> – for incompatible arguments</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy ndarray, shape=(N,N)</p>
</dd>
</dl>
<p>Add elements of two poses.  This is not a group operation so the
result is a matrix not a pose class.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">+</span> <span class="pre">Y</span></code> is the element-wise sum of the matrix value of <code class="docutils literal notranslate"><span class="pre">X</span></code> and <code class="docutils literal notranslate"><span class="pre">Y</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">+</span> <span class="pre">s</span></code> is the element-wise sum of the matrix value of <code class="docutils literal notranslate"><span class="pre">X</span></code> and <code class="docutils literal notranslate"><span class="pre">s</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">s</span> <span class="pre">+</span> <span class="pre">X</span></code> is the element-wise sum of the matrix value of <code class="docutils literal notranslate"><span class="pre">s</span></code> and <code class="docutils literal notranslate"><span class="pre">X</span></code></p></li>
</ul>
<table class="docutils align-default">
<colgroup>
<col style="width: 22%" />
<col style="width: 22%" />
<col style="width: 17%" />
<col style="width: 38%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head" colspan="2"><p>Operands</p></th>
<th class="head" colspan="2"><p>Sum</p></th>
</tr>
<tr class="row-even"><th class="head"><p>left</p></th>
<th class="head"><p>right</p></th>
<th class="head"><p>type</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-odd"><td><p>Pose</p></td>
<td><p>Pose</p></td>
<td><p>NxN matrix</p></td>
<td><p>element-wise matrix sum</p></td>
</tr>
<tr class="row-even"><td><p>Pose</p></td>
<td><p>scalar</p></td>
<td><p>NxN matrix</p></td>
<td><p>element-wise sum</p></td>
</tr>
<tr class="row-odd"><td><p>scalar</p></td>
<td><p>Pose</p></td>
<td><p>NxN matrix</p></td>
<td><p>element-wise sum</p></td>
</tr>
</tbody>
</table>
<p>Notes:</p>
<ol class="arabic simple">
<li><p>Pose is <code class="docutils literal notranslate"><span class="pre">SO2</span></code>, <code class="docutils literal notranslate"><span class="pre">SE2</span></code>, <code class="docutils literal notranslate"><span class="pre">SO3</span></code> or <code class="docutils literal notranslate"><span class="pre">SE3</span></code> instance</p></li>
<li><p>N is 2 for <code class="docutils literal notranslate"><span class="pre">SO2</span></code>, <code class="docutils literal notranslate"><span class="pre">SE2</span></code>; 3 for <code class="docutils literal notranslate"><span class="pre">SO3</span></code> or <code class="docutils literal notranslate"><span class="pre">SE3</span></code></p></li>
<li><p>scalar + Pose is handled by <code class="docutils literal notranslate"><span class="pre">__radd__</span></code></p></li>
<li><p>scalar addition is commutative</p></li>
<li><p>Any other input combinations result in a ValueError.</p></li>
</ol>
<p>For pose addition the <code class="docutils literal notranslate"><span class="pre">left</span></code> and <code class="docutils literal notranslate"><span class="pre">right</span></code> operands may be a sequence which
results in the result being a sequence:</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 16%" />
<col style="width: 18%" />
<col style="width: 7%" />
<col style="width: 58%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>len(left)</p></th>
<th class="head"><p>len(right)</p></th>
<th class="head"><p>len</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">+</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">+</span> <span class="pre">right[i]</span></code></p></td>
</tr>
<tr class="row-even"><td><p>N</p></td>
<td><p>1</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">+</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>M</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">+</span> <span class="pre">right[i]</span></code></p></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.__eq__">
<code class="sig-name descname">__eq__</code><span class="sig-paren">(</span><em class="sig-param">right</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SO2.__eq__" title="Permalink to this definition">¶</a></dt>
<dd><p>Overloaded <code class="docutils literal notranslate"><span class="pre">==</span></code> operator (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>left</strong> – left side of comparison</p></li>
<li><p><strong>right</strong> – right side of comparison</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>poses are equal</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
<p>Test two poses for equality</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">==</span> <span class="pre">Y</span></code> is true of the poses are of the same type and numerically
equal.</p></li>
</ul>
<p>If either operand contains a sequence the results is a sequence 
according to:</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 16%" />
<col style="width: 18%" />
<col style="width: 7%" />
<col style="width: 58%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>len(left)</p></th>
<th class="head"><p>len(right)</p></th>
<th class="head"><p>len</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">ret</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">==</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">ret[i]</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">==</span> <span class="pre">right[i]</span></code></p></td>
</tr>
<tr class="row-even"><td><p>N</p></td>
<td><p>1</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">ret[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">==</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>M</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">ret[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">==</span> <span class="pre">right[i]</span></code></p></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.__mul__">
<code class="sig-name descname">__mul__</code><span class="sig-paren">(</span><em class="sig-param">right</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SO2.__mul__" title="Permalink to this definition">¶</a></dt>
<dd><p>Overloaded <code class="docutils literal notranslate"><span class="pre">*</span></code> operator (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>left</strong> – left multiplicand</p></li>
<li><p><strong>right</strong> – right multiplicand</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>product</p>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p>ValueError</p>
</dd>
</dl>
<p>Pose composition, scaling or vector transformation:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">*</span> <span class="pre">Y</span></code> compounds the poses <code class="docutils literal notranslate"><span class="pre">X</span></code> and <code class="docutils literal notranslate"><span class="pre">Y</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">*</span> <span class="pre">s</span></code> performs elementwise multiplication of the elements of <code class="docutils literal notranslate"><span class="pre">X</span></code> by <code class="docutils literal notranslate"><span class="pre">s</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">s</span> <span class="pre">*</span> <span class="pre">X</span></code> performs elementwise multiplication of the elements of <code class="docutils literal notranslate"><span class="pre">X</span></code> by <code class="docutils literal notranslate"><span class="pre">s</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">*</span> <span class="pre">v</span></code> linear transform of the vector <code class="docutils literal notranslate"><span class="pre">v</span></code></p></li>
</ul>
<table class="docutils align-default">
<colgroup>
<col style="width: 23%" />
<col style="width: 23%" />
<col style="width: 18%" />
<col style="width: 36%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head" colspan="2"><p>Multiplicands</p></th>
<th class="head" colspan="2"><p>Product</p></th>
</tr>
<tr class="row-even"><th class="head"><p>left</p></th>
<th class="head"><p>right</p></th>
<th class="head"><p>type</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-odd"><td><p>Pose</p></td>
<td><p>Pose</p></td>
<td><p>Pose</p></td>
<td><p>matrix product</p></td>
</tr>
<tr class="row-even"><td><p>Pose</p></td>
<td><p>scalar</p></td>
<td><p>NxN matrix</p></td>
<td><p>element-wise product</p></td>
</tr>
<tr class="row-odd"><td><p>scalar</p></td>
<td><p>Pose</p></td>
<td><p>NxN matrix</p></td>
<td><p>element-wise product</p></td>
</tr>
<tr class="row-even"><td><p>Pose</p></td>
<td><p>N-vector</p></td>
<td><p>N-vector</p></td>
<td><p>vector transform</p></td>
</tr>
<tr class="row-odd"><td><p>Pose</p></td>
<td><p>NxM matrix</p></td>
<td><p>NxM matrix</p></td>
<td><p>transform each column</p></td>
</tr>
</tbody>
</table>
<p>Notes:</p>
<ol class="arabic simple">
<li><p>Pose is <code class="docutils literal notranslate"><span class="pre">SO2</span></code>, <code class="docutils literal notranslate"><span class="pre">SE2</span></code>, <code class="docutils literal notranslate"><span class="pre">SO3</span></code> or <code class="docutils literal notranslate"><span class="pre">SE3</span></code> instance</p></li>
<li><p>N is 2 for <code class="docutils literal notranslate"><span class="pre">SO2</span></code>, <code class="docutils literal notranslate"><span class="pre">SE2</span></code>; 3 for <code class="docutils literal notranslate"><span class="pre">SO3</span></code> or <code class="docutils literal notranslate"><span class="pre">SE3</span></code></p></li>
<li><p>scalar x Pose is handled by <code class="docutils literal notranslate"><span class="pre">__rmul__</span></code></p></li>
<li><p>scalar multiplication is commutative but the result is not a group
operation so the result will be a matrix</p></li>
<li><p>Any other input combinations result in a ValueError.</p></li>
</ol>
<p>For pose composition the <code class="docutils literal notranslate"><span class="pre">left</span></code> and <code class="docutils literal notranslate"><span class="pre">right</span></code> operands may be a sequence</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 16%" />
<col style="width: 18%" />
<col style="width: 7%" />
<col style="width: 58%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>len(left)</p></th>
<th class="head"><p>len(right)</p></th>
<th class="head"><p>len</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">*</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">*</span> <span class="pre">right[i]</span></code></p></td>
</tr>
<tr class="row-even"><td><p>N</p></td>
<td><p>1</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">*</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>M</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">*</span> <span class="pre">right[i]</span></code></p></td>
</tr>
</tbody>
</table>
<p>For vector transformation there are three cases</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 18%" />
<col style="width: 22%" />
<col style="width: 10%" />
<col style="width: 51%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head" colspan="2"><p>Multiplicands</p></th>
<th class="head" colspan="2"><p>Product</p></th>
</tr>
<tr class="row-even"><th class="head"><p>len(left)</p></th>
<th class="head"><p>right.shape</p></th>
<th class="head"><p>shape</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-odd"><td><p>1</p></td>
<td><p>(N,)</p></td>
<td><p>(N,)</p></td>
<td><p>vector transformation</p></td>
</tr>
<tr class="row-even"><td><p>M</p></td>
<td><p>(N,)</p></td>
<td><p>(N,M)</p></td>
<td><p>vector transformations</p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>(N,M)</p></td>
<td><p>(N,M)</p></td>
<td><p>column transformation</p></td>
</tr>
</tbody>
</table>
<p>Notes:</p>
<ol class="arabic simple">
<li><p>for the <code class="docutils literal notranslate"><span class="pre">SE2</span></code> and <code class="docutils literal notranslate"><span class="pre">SE3</span></code> case the vectors are converted to homogeneous
form, transformed, then converted back to Euclidean form.</p></li>
</ol>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.__ne__">
<code class="sig-name descname">__ne__</code><span class="sig-paren">(</span><em class="sig-param">right</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SO2.__ne__" title="Permalink to this definition">¶</a></dt>
<dd><p>Overloaded <code class="docutils literal notranslate"><span class="pre">!=</span></code> operator</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>left</strong> – left side of comparison</p></li>
<li><p><strong>right</strong> – right side of comparison</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>poses are not equal</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
<p>Test two poses for inequality</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">==</span> <span class="pre">Y</span></code> is true of the poses are of the same type but not numerically
equal.</p></li>
</ul>
<p>If either operand contains a sequence the results is a sequence 
according to:</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 16%" />
<col style="width: 18%" />
<col style="width: 7%" />
<col style="width: 58%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>len(left)</p></th>
<th class="head"><p>len(right)</p></th>
<th class="head"><p>len</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">ret</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">!=</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">ret[i]</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">!=</span> <span class="pre">right[i]</span></code></p></td>
</tr>
<tr class="row-even"><td><p>N</p></td>
<td><p>1</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">ret[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">!=</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>M</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">ret[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">!=</span> <span class="pre">right[i]</span></code></p></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.__pow__">
<code class="sig-name descname">__pow__</code><span class="sig-paren">(</span><em class="sig-param">n</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SO2.__pow__" title="Permalink to this definition">¶</a></dt>
<dd><p>Overloaded <code class="docutils literal notranslate"><span class="pre">**</span></code> operator (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>n</strong> – pose</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>pose to the power n</p>
</dd>
</dl>
<p>Raise all elements of pose to the specified power.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X**n</span></code> raise all values in <code class="docutils literal notranslate"><span class="pre">X</span></code> to the power <code class="docutils literal notranslate"><span class="pre">n</span></code></p></li>
</ul>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.__sub__">
<code class="sig-name descname">__sub__</code><span class="sig-paren">(</span><em class="sig-param">right</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SO2.__sub__" title="Permalink to this definition">¶</a></dt>
<dd><p>Overloaded <code class="docutils literal notranslate"><span class="pre">-</span></code> operator (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>left</strong> – left minuend</p></li>
<li><p><strong>right</strong> – right subtrahend</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>difference</p>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><strong>ValueError</strong> – for incompatible arguments</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy ndarray, shape=(N,N)</p>
</dd>
</dl>
<p>Subtract elements of two poses.  This is not a group operation so the
result is a matrix not a pose class.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">-</span> <span class="pre">Y</span></code> is the element-wise difference of the matrix value of <code class="docutils literal notranslate"><span class="pre">X</span></code> and <code class="docutils literal notranslate"><span class="pre">Y</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">-</span> <span class="pre">s</span></code> is the element-wise difference of the matrix value of <code class="docutils literal notranslate"><span class="pre">X</span></code> and <code class="docutils literal notranslate"><span class="pre">s</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">s</span> <span class="pre">-</span> <span class="pre">X</span></code> is the element-wise difference of <code class="docutils literal notranslate"><span class="pre">s</span></code> and the matrix value of <code class="docutils literal notranslate"><span class="pre">X</span></code></p></li>
</ul>
<table class="docutils align-default">
<colgroup>
<col style="width: 20%" />
<col style="width: 20%" />
<col style="width: 16%" />
<col style="width: 43%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head" colspan="2"><p>Operands</p></th>
<th class="head" colspan="2"><p>Sum</p></th>
</tr>
<tr class="row-even"><th class="head"><p>left</p></th>
<th class="head"><p>right</p></th>
<th class="head"><p>type</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-odd"><td><p>Pose</p></td>
<td><p>Pose</p></td>
<td><p>NxN matrix</p></td>
<td><p>element-wise matrix difference</p></td>
</tr>
<tr class="row-even"><td><p>Pose</p></td>
<td><p>scalar</p></td>
<td><p>NxN matrix</p></td>
<td><p>element-wise sum</p></td>
</tr>
<tr class="row-odd"><td><p>scalar</p></td>
<td><p>Pose</p></td>
<td><p>NxN matrix</p></td>
<td><p>element-wise sum</p></td>
</tr>
</tbody>
</table>
<p>Notes:</p>
<ol class="arabic simple">
<li><p>Pose is <code class="docutils literal notranslate"><span class="pre">SO2</span></code>, <code class="docutils literal notranslate"><span class="pre">SE2</span></code>, <code class="docutils literal notranslate"><span class="pre">SO3</span></code> or <code class="docutils literal notranslate"><span class="pre">SE3</span></code> instance</p></li>
<li><p>N is 2 for <code class="docutils literal notranslate"><span class="pre">SO2</span></code>, <code class="docutils literal notranslate"><span class="pre">SE2</span></code>; 3 for <code class="docutils literal notranslate"><span class="pre">SO3</span></code> or <code class="docutils literal notranslate"><span class="pre">SE3</span></code></p></li>
<li><p>scalar - Pose is handled by <code class="docutils literal notranslate"><span class="pre">__rsub__</span></code></p></li>
<li><p>Any other input combinations result in a ValueError.</p></li>
</ol>
<p>For pose addition the <code class="docutils literal notranslate"><span class="pre">left</span></code> and <code class="docutils literal notranslate"><span class="pre">right</span></code> operands may be a sequence which
results in the result being a sequence:</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 16%" />
<col style="width: 18%" />
<col style="width: 7%" />
<col style="width: 58%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>len(left)</p></th>
<th class="head"><p>len(right)</p></th>
<th class="head"><p>len</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">-</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">-</span> <span class="pre">right[i]</span></code></p></td>
</tr>
<tr class="row-even"><td><p>N</p></td>
<td><p>1</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">-</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>M</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span>&#160; <span class="pre">right[i]</span></code></p></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.__truediv__">
<code class="sig-name descname">__truediv__</code><span class="sig-paren">(</span><em class="sig-param">right</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SO2.__truediv__" title="Permalink to this definition">¶</a></dt>
<dd><p>Overloaded <code class="docutils literal notranslate"><span class="pre">/</span></code> operator (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>left</strong> – left multiplicand</p></li>
<li><p><strong>right</strong> – right multiplicand</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>product</p>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><strong>ValueError</strong> – for incompatible arguments</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy ndarray</p>
</dd>
</dl>
<p>Pose composition or scaling:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">/</span> <span class="pre">Y</span></code> compounds the poses <code class="docutils literal notranslate"><span class="pre">X</span></code> and <code class="docutils literal notranslate"><span class="pre">Y.inv()</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">/</span> <span class="pre">s</span></code> performs elementwise multiplication of the elements of <code class="docutils literal notranslate"><span class="pre">X</span></code> by <code class="docutils literal notranslate"><span class="pre">s</span></code></p></li>
</ul>
<table class="docutils align-default">
<colgroup>
<col style="width: 22%" />
<col style="width: 22%" />
<col style="width: 17%" />
<col style="width: 39%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head" colspan="2"><p>Multiplicands</p></th>
<th class="head" colspan="2"><p>Quotient</p></th>
</tr>
<tr class="row-even"><th class="head"><p>left</p></th>
<th class="head"><p>right</p></th>
<th class="head"><p>type</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-odd"><td><p>Pose</p></td>
<td><p>Pose</p></td>
<td><p>Pose</p></td>
<td><p>matrix product by inverse</p></td>
</tr>
<tr class="row-even"><td><p>Pose</p></td>
<td><p>scalar</p></td>
<td><p>NxN matrix</p></td>
<td><p>element-wise division</p></td>
</tr>
</tbody>
</table>
<p>Notes:</p>
<ol class="arabic simple">
<li><p>Pose is <code class="docutils literal notranslate"><span class="pre">SO2</span></code>, <code class="docutils literal notranslate"><span class="pre">SE2</span></code>, <code class="docutils literal notranslate"><span class="pre">SO3</span></code> or <code class="docutils literal notranslate"><span class="pre">SE3</span></code> instance</p></li>
<li><p>N is 2 for <code class="docutils literal notranslate"><span class="pre">SO2</span></code>, <code class="docutils literal notranslate"><span class="pre">SE2</span></code>; 3 for <code class="docutils literal notranslate"><span class="pre">SO3</span></code> or <code class="docutils literal notranslate"><span class="pre">SE3</span></code></p></li>
<li><p>scalar multiplication is not a group operation so the result will 
be a matrix</p></li>
<li><p>Any other input combinations result in a ValueError.</p></li>
</ol>
<p>For pose composition the <code class="docutils literal notranslate"><span class="pre">left</span></code> and <code class="docutils literal notranslate"><span class="pre">right</span></code> operands may be a sequence</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 15%" />
<col style="width: 16%" />
<col style="width: 7%" />
<col style="width: 62%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>len(left)</p></th>
<th class="head"><p>len(right)</p></th>
<th class="head"><p>len</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">*</span> <span class="pre">right.inv()</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">*</span> <span class="pre">right[i].inv()</span></code></p></td>
</tr>
<tr class="row-even"><td><p>N</p></td>
<td><p>1</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">*</span> <span class="pre">right.inv()</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>M</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">*</span> <span class="pre">right[i].inv()</span></code></p></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.about">
<em class="property">property </em><code class="sig-name descname">about</code><a class="headerlink" href="#spatialmath.pose2d.SO2.about" title="Permalink to this definition">¶</a></dt>
<dd><p>Succinct summary of object type and length (superclass property)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>succinct summary</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>str</p>
</dd>
</dl>
<p>Displays the type and the number of elements in compact form, for 
example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">([</span><span class="n">SE3</span><span class="p">()</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">20</span><span class="p">)])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">20</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">x</span><span class="o">.</span><span class="n">about</span><span class="p">)</span>
<span class="go">SE3[20]</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.animate">
<code class="sig-name descname">animate</code><span class="sig-paren">(</span><em class="sig-param">*args</em>, <em class="sig-param">T0=None</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SO2.animate" title="Permalink to this definition">¶</a></dt>
<dd><p>Plot pose object as an animated coordinate frame (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>**kwargs</strong> – plotting options</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X.plot()</span></code> displays the pose <code class="docutils literal notranslate"><span class="pre">X</span></code> as a coordinate frame moving
from the origin, or <code class="docutils literal notranslate"><span class="pre">T0</span></code>, in either 2D or 3D axes.  There are 
many options, see the links below.</p></li>
</ul>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">X</span> <span class="o">=</span> <span class="n">SE3</span><span class="o">.</span><span class="n">Rx</span><span class="p">(</span><span class="mf">0.3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">X</span><span class="o">.</span><span class="n">animate</span><span class="p">(</span><span class="n">frame</span><span class="o">=</span><span class="s1">&#39;A&#39;</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s1">&#39;green&#39;</span><span class="p">)</span>
</pre></div>
</div>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.tranimate" title="spatialmath.base.transforms3d.tranimate"><code class="xref py py-func docutils literal notranslate"><span class="pre">tranimate()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms2d.tranimate2" title="spatialmath.base.transforms2d.tranimate2"><code class="xref py py-func docutils literal notranslate"><span class="pre">tranimate2()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.append">
<code class="sig-name descname">append</code><span class="sig-paren">(</span><em class="sig-param">x</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SO2.append" title="Permalink to this definition">¶</a></dt>
<dd><p>Append a value to a pose object (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>x</strong> (<a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2"><em>SO2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><em>SE2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3"><em>SO3</em></a><em>, </em><em>SE3 instance</em>) – the value to append</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>ValueError</strong> – incorrect type of appended object</p>
</dd>
</dl>
<p>Appends the argument to the object’s internal list of values.</p>
<p>Examples:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">SE3</span><span class="o">.</span><span class="n">Rx</span><span class="p">(</span><span class="mf">0.1</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">2</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.clear">
<code class="sig-name descname">clear</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None -- remove all items from S<a class="headerlink" href="#spatialmath.pose2d.SO2.clear" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.extend">
<code class="sig-name descname">extend</code><span class="sig-paren">(</span><em class="sig-param">x</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SO2.extend" title="Permalink to this definition">¶</a></dt>
<dd><p>Extend sequence of values of a pose object (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>x</strong> (<a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2"><em>SO2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><em>SE2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3"><em>SO3</em></a><em>, </em><em>SE3 instance</em>) – the value to extend</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>ValueError</strong> – incorrect type of appended object</p>
</dd>
</dl>
<p>Appends the argument to the object’s internal list of values.</p>
<p>Examples:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">SE3</span><span class="o">.</span><span class="n">Rx</span><span class="p">(</span><span class="mf">0.1</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">2</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.insert">
<code class="sig-name descname">insert</code><span class="sig-paren">(</span><em class="sig-param">i</em>, <em class="sig-param">value</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SO2.insert" title="Permalink to this definition">¶</a></dt>
<dd><p>Insert a value to a pose object (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>i</strong> (<em>int</em>) – element to insert value before</p></li>
<li><p><strong>value</strong> (<a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2"><em>SO2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><em>SE2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3"><em>SO3</em></a><em>, </em><em>SE3 instance</em>) – the value to insert</p></li>
</ul>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>ValueError</strong> – incorrect type of inserted value</p>
</dd>
</dl>
<p>Inserts the argument into the object’s internal list of values.</p>
<p>Examples:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">inert</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">SE3</span><span class="o">.</span><span class="n">Rx</span><span class="p">(</span><span class="mf">0.1</span><span class="p">))</span> <span class="c1"># insert at position 0 in the list</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">2</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.interp">
<code class="sig-name descname">interp</code><span class="sig-paren">(</span><em class="sig-param">s=None</em>, <em class="sig-param">T0=None</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SO2.interp" title="Permalink to this definition">¶</a></dt>
<dd><p>Interpolate pose (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>T0</strong> (<a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2"><em>SO2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><em>SE2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3"><em>SO3</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SE3" title="spatialmath.pose3d.SE3"><em>SE3</em></a>) – initial pose</p></li>
<li><p><strong>s</strong> (<em>float</em><em> or </em><em>array_like</em>) – interpolation coefficient, range 0 to 1</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>interpolated pose</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2">SO2</a>, <a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2">SE2</a>, <a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3">SO3</a>, SE3 instance</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X.interp(s)</span></code> interpolates the pose X between identity when s=0
and X when s=1.</p></li>
</ul>
<blockquote>
<div><table class="docutils align-default">
<colgroup>
<col style="width: 11%" />
<col style="width: 11%" />
<col style="width: 20%" />
<col style="width: 57%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>len(X)</p></th>
<th class="head"><p>len(s)</p></th>
<th class="head"><p>len(result)</p></th>
<th class="head"><p>Result</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p>Y = interp(identity, X, s)</p></td>
</tr>
<tr class="row-odd"><td><p>M</p></td>
<td><p>1</p></td>
<td><p>M</p></td>
<td><p>Y[i] = interp(T0, X[i], s)</p></td>
</tr>
<tr class="row-even"><td><p>1</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p>Y[i] = interp(T0, X, s[i])</p></td>
</tr>
</tbody>
</table>
</div></blockquote>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="o">.</span><span class="n">Rx</span><span class="p">(</span><span class="mf">0.3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">x</span><span class="o">.</span><span class="n">interp</span><span class="p">(</span><span class="mi">0</span><span class="p">))</span>
<span class="go">SE3(array([[1., 0., 0., 0.],</span>
<span class="go">           [0., 1., 0., 0.],</span>
<span class="go">           [0., 0., 1., 0.],</span>
<span class="go">           [0., 0., 0., 1.]]))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">x</span><span class="o">.</span><span class="n">interp</span><span class="p">(</span><span class="mi">1</span><span class="p">))</span>
<span class="go">SE3(array([[ 1.        ,  0.        ,  0.        ,  0.        ],</span>
<span class="go">           [ 0.        ,  0.95533649, -0.29552021,  0.        ],</span>
<span class="go">           [ 0.        ,  0.29552021,  0.95533649,  0.        ],</span>
<span class="go">           [ 0.        ,  0.        ,  0.        ,  1.        ]]))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span> <span class="o">=</span> <span class="n">x</span><span class="o">.</span><span class="n">interp</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">linspace</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">10</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">y</span><span class="p">)</span>
<span class="go">10</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span><span class="p">[</span><span class="mi">5</span><span class="p">]</span>
<span class="go">SE3(array([[ 1.        ,  0.        ,  0.        ,  0.        ],</span>
<span class="go">           [ 0.        ,  0.98614323, -0.16589613,  0.        ],</span>
<span class="go">           [ 0.        ,  0.16589613,  0.98614323,  0.        ],</span>
<span class="go">           [ 0.        ,  0.        ,  0.        ,  1.        ]]))</span>
</pre></div>
</div>
<p>Notes:</p>
<ol class="arabic simple">
<li><p>For SO3 and SE3 rotation is interpolated using quaternion spherical linear interpolation (slerp).</p></li>
</ol>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.trinterp" title="spatialmath.base.transforms3d.trinterp"><code class="xref py py-func docutils literal notranslate"><span class="pre">trinterp()</span></code></a>, <a class="reference internal" href="#spatialmath.base.quaternions.slerp" title="spatialmath.base.quaternions.slerp"><code class="xref py py-func docutils literal notranslate"><span class="pre">spatialmath.base.quaternions.slerp()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms2d.trinterp2" title="spatialmath.base.transforms2d.trinterp2"><code class="xref py py-func docutils literal notranslate"><span class="pre">trinterp2()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.isSE">
<em class="property">property </em><code class="sig-name descname">isSE</code><a class="headerlink" href="#spatialmath.pose2d.SO2.isSE" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if object belongs to SE(n) group (superclass property)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>self</strong> (<a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2"><em>SO2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><em>SE2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3"><em>SO3</em></a><em>, </em><em>SE3 instance</em>) – object to test</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">True</span></code> if object is instance of SE2 or SE3</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.isSO">
<em class="property">property </em><code class="sig-name descname">isSO</code><a class="headerlink" href="#spatialmath.pose2d.SO2.isSO" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if object belongs to SO(n) group (superclass property)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>self</strong> (<a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2"><em>SO2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><em>SE2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3"><em>SO3</em></a><em>, </em><em>SE3 instance</em>) – object to test</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">True</span></code> if object is instance of SO2 or SO3</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.ishom">
<code class="sig-name descname">ishom</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SO2.ishom" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if object belongs to SE(3) group (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">True</span></code> if object is instance of SE3</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>bool</p>
</dd>
</dl>
<p>For compatibility with Spatial Math Toolbox for MATLAB.
In Python use <code class="docutils literal notranslate"><span class="pre">isinstance(x,</span> <span class="pre">SE3)</span></code>.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SO3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">isrot</span><span class="p">()</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">isrot</span><span class="p">()</span>
<span class="go">True</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.ishom2">
<code class="sig-name descname">ishom2</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SO2.ishom2" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if object belongs to SE(2) group (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">True</span></code> if object is instance of SE2</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>bool</p>
</dd>
</dl>
<p>For compatibility with Spatial Math Toolbox for MATLAB.
In Python use <code class="docutils literal notranslate"><span class="pre">isinstance(x,</span> <span class="pre">SE2)</span></code>.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SO2</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">isrot</span><span class="p">()</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE2</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">isrot</span><span class="p">()</span>
<span class="go">True</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.isrot">
<code class="sig-name descname">isrot</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SO2.isrot" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if object belongs to SO(3) group (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">True</span></code> if object is instance of SO3</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>bool</p>
</dd>
</dl>
<p>For compatibility with Spatial Math Toolbox for MATLAB.
In Python use <code class="docutils literal notranslate"><span class="pre">isinstance(x,</span> <span class="pre">SO3)</span></code>.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SO3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">isrot</span><span class="p">()</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">isrot</span><span class="p">()</span>
<span class="go">False</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.isrot2">
<code class="sig-name descname">isrot2</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SO2.isrot2" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if object belongs to SO(2) group (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">True</span></code> if object is instance of SO2</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>bool</p>
</dd>
</dl>
<p>For compatibility with Spatial Math Toolbox for MATLAB.
In Python use <code class="docutils literal notranslate"><span class="pre">isinstance(x,</span> <span class="pre">SO2)</span></code>.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SO2</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">isrot</span><span class="p">()</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE2</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">isrot</span><span class="p">()</span>
<span class="go">False</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.log">
<code class="sig-name descname">log</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SO2.log" title="Permalink to this definition">¶</a></dt>
<dd><p>Logarithm of pose (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>logarithm</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>numpy.ndarray</p>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p>ValueError</p>
</dd>
</dl>
<p>An efficient closed-form solution of the matrix logarithm.</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 12%" />
<col style="width: 14%" />
<col style="width: 74%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Input</p></th>
<th class="head" colspan="2"><p>Output</p></th>
</tr>
<tr class="row-even"><th class="head"><p>Pose</p></th>
<th class="head"><p>Shape</p></th>
<th class="head"><p>Structure</p></th>
</tr>
</thead>
<tbody>
<tr class="row-odd"><td><p>SO2</p></td>
<td><p>(2,2)</p></td>
<td><p>skew-symmetric</p></td>
</tr>
<tr class="row-even"><td><p>SE2</p></td>
<td><p>(3,3)</p></td>
<td><p>augmented skew-symmetric</p></td>
</tr>
<tr class="row-odd"><td><p>SO3</p></td>
<td><p>(3,3)</p></td>
<td><p>skew-symmetric</p></td>
</tr>
<tr class="row-even"><td><p>SE3</p></td>
<td><p>(4,4)</p></td>
<td><p>augmented skew-symmetric</p></td>
</tr>
</tbody>
</table>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="o">.</span><span class="n">Rx</span><span class="p">(</span><span class="mf">0.3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span> <span class="o">=</span> <span class="n">x</span><span class="o">.</span><span class="n">log</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span>
<span class="go">array([[ 0. , -0. ,  0. ,  0. ],</span>
<span class="go">       [ 0. ,  0. , -0.3,  0. ],</span>
<span class="go">       [-0. ,  0.3,  0. ,  0. ],</span>
<span class="go">       [ 0. ,  0. ,  0. ,  0. ]])</span>
</pre></div>
</div>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms2d.trlog2" title="spatialmath.base.transforms2d.trlog2"><code class="xref py py-func docutils literal notranslate"><span class="pre">trlog2()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms3d.trlog" title="spatialmath.base.transforms3d.trlog"><code class="xref py py-func docutils literal notranslate"><span class="pre">trlog()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.norm">
<code class="sig-name descname">norm</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SO2.norm" title="Permalink to this definition">¶</a></dt>
<dd><p>Normalize pose (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>pose</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2">SO2</a>, <a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2">SE2</a>, <a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3">SO3</a>, SE3 instance</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X.norm()</span></code> is an equivalent pose object but the rotational matrix 
part of all values has been adjusted to ensure it is a proper orthogonal
matrix rotation.</p></li>
</ul>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span> <span class="o">=</span> <span class="n">x</span><span class="o">.</span><span class="n">norm</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span>
<span class="go">SE3(array([[1., 0., 0., 0.],</span>
<span class="go">           [0., 1., 0., 0.],</span>
<span class="go">           [0., 0., 1., 0.],</span>
<span class="go">           [0., 0., 0., 1.]]))</span>
</pre></div>
</div>
<p>Notes:</p>
<ol class="arabic simple">
<li><p>Only the direction of A vector (the z-axis) is unchanged.</p></li>
<li><p>Used to prevent finite word length arithmetic causing transforms to 
become ‘unnormalized’.</p></li>
</ol>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.trnorm" title="spatialmath.base.transforms3d.trnorm"><code class="xref py py-func docutils literal notranslate"><span class="pre">trnorm()</span></code></a>, <code class="xref py py-func docutils literal notranslate"><span class="pre">trnorm2()</span></code></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.plot">
<code class="sig-name descname">plot</code><span class="sig-paren">(</span><em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SO2.plot" title="Permalink to this definition">¶</a></dt>
<dd><p>Plot pose object as a coordinate frame (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>**kwargs</strong> – plotting options</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X.plot()</span></code> displays the pose <code class="docutils literal notranslate"><span class="pre">X</span></code> as a coordinate frame in either
2D or 3D axes.  There are many options, see the links below.</p></li>
</ul>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">X</span> <span class="o">=</span> <span class="n">SE3</span><span class="o">.</span><span class="n">Rx</span><span class="p">(</span><span class="mf">0.3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">X</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">frame</span><span class="o">=</span><span class="s1">&#39;A&#39;</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s1">&#39;green&#39;</span><span class="p">)</span>
</pre></div>
</div>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.trplot" title="spatialmath.base.transforms3d.trplot"><code class="xref py py-func docutils literal notranslate"><span class="pre">trplot()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms2d.trplot2" title="spatialmath.base.transforms2d.trplot2"><code class="xref py py-func docutils literal notranslate"><span class="pre">trplot2()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.pop">
<code class="sig-name descname">pop</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SO2.pop" title="Permalink to this definition">¶</a></dt>
<dd><p>Pop value of a pose object (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>the specific element of the pose</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2">SO2</a>, <a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2">SE2</a>, <a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3">SO3</a>, SE3 instance</p>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><strong>IndexError</strong> – if there are no values to pop</p>
</dd>
</dl>
<p>Removes the first pose value from the sequence in the pose object.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="o">.</span><span class="n">Rx</span><span class="p">([</span><span class="mi">0</span><span class="p">,</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="o">/</span><span class="mi">2</span><span class="p">,</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">3</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span> <span class="o">=</span> <span class="n">x</span><span class="o">.</span><span class="n">pop</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span>
<span class="go">SE3(array([[ 1.0000000e+00,  0.0000000e+00,  0.0000000e+00,  0.0000000e+00],</span>
<span class="go">           [ 0.0000000e+00, -1.0000000e+00, -1.2246468e-16,  0.0000000e+00],</span>
<span class="go">           [ 0.0000000e+00,  1.2246468e-16, -1.0000000e+00,  0.0000000e+00],</span>
<span class="go">           [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00,  1.0000000e+00]]))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">2</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.printline">
<code class="sig-name descname">printline</code><span class="sig-paren">(</span><em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SO2.printline" title="Permalink to this definition">¶</a></dt>
<dd><p>Print pose as a single line (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>label</strong> (<em>str</em>) – text label to put at start of line</p></li>
<li><p><strong>file</strong> (<em>str</em>) – file to write formatted string to. [default, stdout]</p></li>
<li><p><strong>fmt</strong> (<em>str</em>) – conversion format for each number as used by <code class="docutils literal notranslate"><span class="pre">format()</span></code></p></li>
<li><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>optional formatted string</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
<p>For SO(3) or SE(3) also:</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>orient</strong> (<em>str</em>) – 3-angle convention to use</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X.printline()</span></code> print <code class="docutils literal notranslate"><span class="pre">X</span></code> in single-line format to <code class="docutils literal notranslate"><span class="pre">stdout</span></code>, followed
by a newline</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">X.printline(file=None)</span></code> return a string containing <code class="docutils literal notranslate"><span class="pre">X</span></code> in 
single-line format</p></li>
</ul>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">=</span><span class="n">SE3</span><span class="o">.</span><span class="n">Rx</span><span class="p">(</span><span class="mf">0.3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">printline</span><span class="p">()</span>
<span class="go">t =        0,        0,        0; rpy/zyx =       17,        0,        0 deg</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.reverse">
<code class="sig-name descname">reverse</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SO2.reverse" title="Permalink to this definition">¶</a></dt>
<dd><p>S.reverse() – reverse <em>IN PLACE</em></p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SO2.shape">
<em class="property">property </em><code class="sig-name descname">shape</code><a class="headerlink" href="#spatialmath.pose2d.SO2.shape" title="Permalink to this definition">¶</a></dt>
<dd><p>Shape of the object’s matrix representation (superclass property)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>matrix shape</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>2-tuple of ints</p>
</dd>
</dl>
<p>(2,2) for <code class="docutils literal notranslate"><span class="pre">SO2</span></code>, (3,3) for <code class="docutils literal notranslate"><span class="pre">SE2</span></code> and <code class="docutils literal notranslate"><span class="pre">SO3</span></code>, and (4,4) for <code class="docutils literal notranslate"><span class="pre">SE3</span></code>.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">shape</span>
<span class="go">(4, 4)</span>
</pre></div>
</div>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="spatialmath.pose2d.SE2">
<em class="property">class </em><code class="sig-prename descclassname">spatialmath.pose2d.</code><code class="sig-name descname">SE2</code><span class="sig-paren">(</span><em class="sig-param">x=None</em>, <em class="sig-param">y=None</em>, <em class="sig-param">theta=None</em>, <em class="sig-param">*</em>, <em class="sig-param">unit='rad'</em>, <em class="sig-param">check=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose2d.html#SE2"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose2d.SE2" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2"><code class="xref py py-class docutils literal notranslate"><span class="pre">spatialmath.pose2d.SO2</span></code></a></p>
<dl class="method">
<dt id="spatialmath.pose2d.SE2.__init__">
<code class="sig-name descname">__init__</code><span class="sig-paren">(</span><em class="sig-param">x=None</em>, <em class="sig-param">y=None</em>, <em class="sig-param">theta=None</em>, <em class="sig-param">*</em>, <em class="sig-param">unit='rad'</em>, <em class="sig-param">check=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose2d.html#SE2.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose2d.SE2.__init__" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct new SE(2) object</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>unit</strong> (<em>str</em><em>, </em><em>optional</em>) – angular units ‘deg’ or ‘rad’ [default] if applicable</p></li>
<li><p><strong>check</strong> (<em>bool</em>) – check for valid SE(2) elements if applicable, default to True</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>homogeneous rigid-body transformation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>SE2 instance</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">SE2()</span></code> is an SE2 instance representing a null motion – the identity matrix</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SE2(x,</span> <span class="pre">y)</span></code> is an SE2 instance representing a pure translation of (<code class="docutils literal notranslate"><span class="pre">x</span></code>, <code class="docutils literal notranslate"><span class="pre">y</span></code>)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SE2(t)</span></code> is an SE2 instance representing a pure translation of (<code class="docutils literal notranslate"><span class="pre">x</span></code>, <code class="docutils literal notranslate"><span class="pre">y</span></code>) where``t``=[x,y] is a 2-element array_like</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SE2(x,</span> <span class="pre">y,</span> <span class="pre">theta)</span></code> is an SE2 instance representing a translation of (<code class="docutils literal notranslate"><span class="pre">x</span></code>, <code class="docutils literal notranslate"><span class="pre">y</span></code>) and a rotation of <code class="docutils literal notranslate"><span class="pre">theta</span></code> radians</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SE2(x,</span> <span class="pre">y,</span> <span class="pre">theta,</span> <span class="pre">unit='deg')</span></code> is an SE2 instance representing a translation of (<code class="docutils literal notranslate"><span class="pre">x</span></code>, <code class="docutils literal notranslate"><span class="pre">y</span></code>) and a rotation of <code class="docutils literal notranslate"><span class="pre">theta</span></code> degrees</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SE2(t)</span></code> is an SE2 instance representing a translation of (<code class="docutils literal notranslate"><span class="pre">x</span></code>, <code class="docutils literal notranslate"><span class="pre">y</span></code>) and a rotation of <code class="docutils literal notranslate"><span class="pre">theta</span></code> where <a href="#id1"><span class="problematic" id="id2">``</span></a>t``=[x,y,theta] is a 3-element array_like</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SE2(T)</span></code> is an SE2 instance with rigid-body motion described by the SE(2) matrix T which is a 3x3 numpy array.  If <code class="docutils literal notranslate"><span class="pre">check</span></code>
is <code class="docutils literal notranslate"><span class="pre">True</span></code> check the matrix belongs to SE(2).</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SE2([T1,</span> <span class="pre">T2,</span> <span class="pre">...</span> <span class="pre">TN])</span></code> is an SE2 instance containing a sequence of N rigid-body motions, each described by an SE(2) matrix
Ti which is a 3x3 numpy array. If <code class="docutils literal notranslate"><span class="pre">check</span></code> is <code class="docutils literal notranslate"><span class="pre">True</span></code> then check each matrix belongs to SE(2).</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SE2([X1,</span> <span class="pre">X2,</span> <span class="pre">...</span> <span class="pre">XN])</span></code> is an SE2 instance containing a sequence of N rigid-body motions, where each Xi is an SE2 instance.</p></li>
</ul>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.Rand">
<em class="property">classmethod </em><code class="sig-name descname">Rand</code><span class="sig-paren">(</span><em class="sig-param">*, xrange=[-1, 1], yrange=[-1, 1], trange=[0, 6.283185307179586], unit='rad', N=1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose2d.html#SE2.Rand"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose2d.SE2.Rand" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct a new random SE(2)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xrange</strong> (<em>2-element sequence</em><em>, </em><em>optional</em>) – x-axis range [min,max], defaults to [-1, 1]</p></li>
<li><p><strong>yrange</strong> (<em>2-element sequence</em><em>, </em><em>optional</em>) – y-axis range [min,max], defaults to [-1, 1]</p></li>
<li><p><strong>trange</strong> – theta range [min,max], defaults to <span class="math notranslate nohighlight">\([0, 2\pi)\)</span></p></li>
<li><p><strong>N</strong> (<em>int</em>) – number of random rotations, defaults to 1</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>homogeneous rigid-body transformation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>SE2 instance</p>
</dd>
</dl>
<p>Return an SE2 instance with random rotation and translation.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">SE2.Rand()</span></code> is a random SE(2) rotation.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SE2.Rand(N)</span></code> is an SE2 object containing a sequence of N random
poses.</p></li>
</ul>
<p>Example, create random ten vehicles in the xy-plane:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="o">.</span><span class="n">Rand</span><span class="p">(</span><span class="n">N</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span> <span class="n">xrange</span><span class="o">=</span><span class="p">[</span><span class="o">-</span><span class="mi">2</span><span class="p">,</span><span class="mi">2</span><span class="p">],</span> <span class="n">yrange</span><span class="o">=</span><span class="p">[</span><span class="o">-</span><span class="mi">2</span><span class="p">,</span><span class="mi">2</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">10</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.Exp">
<em class="property">classmethod </em><code class="sig-name descname">Exp</code><span class="sig-paren">(</span><em class="sig-param">S</em>, <em class="sig-param">check=True</em>, <em class="sig-param">se2=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose2d.html#SE2.Exp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose2d.SE2.Exp" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct a new SE(2) from se(2) Lie algebra</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>S</strong> (<em>numpy ndarray</em>) – element of Lie algebra se(2)</p></li>
<li><p><strong>check</strong> (<em>bool</em>) – check that passed matrix is valid se(2), default True</p></li>
<li><p><strong>se2</strong> (<em>bool</em>) – input is an se(2) matrix (default True)</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>homogeneous transform matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>SE2 instance</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">SE2.Exp(S)</span></code> is an SE(2) rotation defined by its Lie algebra
which is a 3x3 se(2) matrix (skew symmetric)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SE2.Exp(t)</span></code> is an SE(2) rotation defined by a 3-element twist
vector array_like (the unique elements of the se(2) skew-symmetric matrix)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SE2.Exp(T)</span></code> is a sequence of SE(2) rigid-body motions defined by an Nx3 matrix of twist vectors, one per row.</p></li>
</ul>
<p>Note:</p>
<ul class="simple">
<li><p>an input 3x3 matrix is ambiguous, it could be the first or third case above. In this case the argument <code class="docutils literal notranslate"><span class="pre">se2</span></code> is the decider.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><code class="xref py py-func docutils literal notranslate"><span class="pre">spatialmath.base.transforms2d.trexp()</span></code>, <a class="reference internal" href="#spatialmath.base.transformsNd.skew" title="spatialmath.base.transformsNd.skew"><code class="xref py py-func docutils literal notranslate"><span class="pre">spatialmath.base.transformsNd.skew()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.isvalid">
<em class="property">static </em><code class="sig-name descname">isvalid</code><span class="sig-paren">(</span><em class="sig-param">x</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose2d.html#SE2.isvalid"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose2d.SE2.isvalid" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if matrix is valid SE(2)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>x</strong> (<em>numpy.ndarray</em>) – matrix to test</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>true if the matrix is a valid element of SE(2), ie. it is a
3x3 homogeneous rigid-body transformation matrix.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
<dt class="field-even">Seealso</dt>
<dd class="field-even"><p><code class="xref py py-func docutils literal notranslate"><span class="pre">ishom()</span></code></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.A">
<em class="property">property </em><code class="sig-name descname">A</code><a class="headerlink" href="#spatialmath.pose2d.SE2.A" title="Permalink to this definition">¶</a></dt>
<dd><p>Interal array representation (superclass property)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>self</strong> (<a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2"><em>SO2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><em>SE2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3"><em>SO3</em></a><em>, </em><em>SE3 instance</em>) – the pose object</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The numeric array</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray</p>
</dd>
</dl>
<p>Each pose subclass SO(N) or SE(N) are stored internally as a numpy array. This property returns
the array, shape depends on the particular subclass.</p>
<p>Examples:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">A</span>
<span class="go">array([[1., 0., 0., 0.],</span>
<span class="go">       [0., 1., 0., 0.],</span>
<span class="go">       [0., 0., 1., 0.],</span>
<span class="go">       [0., 0., 0., 1.]])</span>
</pre></div>
</div>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><cite>shape</cite>, <cite>N</cite></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.Empty">
<em class="property">classmethod </em><code class="sig-name descname">Empty</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SE2.Empty" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct a new pose object with zero items (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>cls</strong> (<a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2"><em>SO2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><em>SE2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3"><em>SO3</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SE3" title="spatialmath.pose3d.SE3"><em>SE3</em></a>) – The pose subclass</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>a pose with zero values</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2">SO2</a>, <a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2">SE2</a>, <a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3">SO3</a>, SE3 instance</p>
</dd>
</dl>
<p>This constructs an empty pose container which can be appended to.  For example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SO2</span><span class="o">.</span><span class="n">Empty</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">SO2</span><span class="p">(</span><span class="mi">20</span><span class="p">,</span> <span class="s1">&#39;deg&#39;</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">1</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.N">
<em class="property">property </em><code class="sig-name descname">N</code><a class="headerlink" href="#spatialmath.pose2d.SE2.N" title="Permalink to this definition">¶</a></dt>
<dd><p>Dimension of the object’s group (superclass property)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>dimension</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>int</p>
</dd>
</dl>
<p>Dimension of the group is 2 for <code class="docutils literal notranslate"><span class="pre">SO2</span></code> or <code class="docutils literal notranslate"><span class="pre">SE2</span></code>, and 3 for <code class="docutils literal notranslate"><span class="pre">SO3</span></code> or <code class="docutils literal notranslate"><span class="pre">SE3</span></code>.
This corresponds to the dimension of the space, 2D or 3D, to which these
rotations or rigid-body motions apply.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">N</span>
<span class="go">3</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.R">
<em class="property">property </em><code class="sig-name descname">R</code><a class="headerlink" href="#spatialmath.pose2d.SE2.R" title="Permalink to this definition">¶</a></dt>
<dd><p>SO(2) or SE(2) as rotation matrix</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>rotational component</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>numpy.ndarray, shape=(2,2)</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">x.R</span></code> returns the rotation matrix, when <cite>x</cite> is <cite>SO2</cite> or <cite>SE2</cite>. If <cite>len(x)</cite> is:</p>
<ul class="simple">
<li><p>1, return an ndarray with shape=(2,2)</p></li>
<li><p>N&gt;1, return ndarray with shape=(N,2,2)</p></li>
</ul>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.SE2">
<code class="sig-name descname">SE2</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SE2.SE2" title="Permalink to this definition">¶</a></dt>
<dd><p>Create SE(2) from SO(2)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>SE(2) with same rotation but zero translation</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>SE2 instance</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.__add__">
<code class="sig-name descname">__add__</code><span class="sig-paren">(</span><em class="sig-param">right</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SE2.__add__" title="Permalink to this definition">¶</a></dt>
<dd><p>Overloaded <code class="docutils literal notranslate"><span class="pre">+</span></code> operator (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>left</strong> – left addend</p></li>
<li><p><strong>right</strong> – right addend</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>sum</p>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><strong>ValueError</strong> – for incompatible arguments</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy ndarray, shape=(N,N)</p>
</dd>
</dl>
<p>Add elements of two poses.  This is not a group operation so the
result is a matrix not a pose class.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">+</span> <span class="pre">Y</span></code> is the element-wise sum of the matrix value of <code class="docutils literal notranslate"><span class="pre">X</span></code> and <code class="docutils literal notranslate"><span class="pre">Y</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">+</span> <span class="pre">s</span></code> is the element-wise sum of the matrix value of <code class="docutils literal notranslate"><span class="pre">X</span></code> and <code class="docutils literal notranslate"><span class="pre">s</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">s</span> <span class="pre">+</span> <span class="pre">X</span></code> is the element-wise sum of the matrix value of <code class="docutils literal notranslate"><span class="pre">s</span></code> and <code class="docutils literal notranslate"><span class="pre">X</span></code></p></li>
</ul>
<table class="docutils align-default">
<colgroup>
<col style="width: 22%" />
<col style="width: 22%" />
<col style="width: 17%" />
<col style="width: 38%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head" colspan="2"><p>Operands</p></th>
<th class="head" colspan="2"><p>Sum</p></th>
</tr>
<tr class="row-even"><th class="head"><p>left</p></th>
<th class="head"><p>right</p></th>
<th class="head"><p>type</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-odd"><td><p>Pose</p></td>
<td><p>Pose</p></td>
<td><p>NxN matrix</p></td>
<td><p>element-wise matrix sum</p></td>
</tr>
<tr class="row-even"><td><p>Pose</p></td>
<td><p>scalar</p></td>
<td><p>NxN matrix</p></td>
<td><p>element-wise sum</p></td>
</tr>
<tr class="row-odd"><td><p>scalar</p></td>
<td><p>Pose</p></td>
<td><p>NxN matrix</p></td>
<td><p>element-wise sum</p></td>
</tr>
</tbody>
</table>
<p>Notes:</p>
<ol class="arabic simple">
<li><p>Pose is <code class="docutils literal notranslate"><span class="pre">SO2</span></code>, <code class="docutils literal notranslate"><span class="pre">SE2</span></code>, <code class="docutils literal notranslate"><span class="pre">SO3</span></code> or <code class="docutils literal notranslate"><span class="pre">SE3</span></code> instance</p></li>
<li><p>N is 2 for <code class="docutils literal notranslate"><span class="pre">SO2</span></code>, <code class="docutils literal notranslate"><span class="pre">SE2</span></code>; 3 for <code class="docutils literal notranslate"><span class="pre">SO3</span></code> or <code class="docutils literal notranslate"><span class="pre">SE3</span></code></p></li>
<li><p>scalar + Pose is handled by <code class="docutils literal notranslate"><span class="pre">__radd__</span></code></p></li>
<li><p>scalar addition is commutative</p></li>
<li><p>Any other input combinations result in a ValueError.</p></li>
</ol>
<p>For pose addition the <code class="docutils literal notranslate"><span class="pre">left</span></code> and <code class="docutils literal notranslate"><span class="pre">right</span></code> operands may be a sequence which
results in the result being a sequence:</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 16%" />
<col style="width: 18%" />
<col style="width: 7%" />
<col style="width: 58%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>len(left)</p></th>
<th class="head"><p>len(right)</p></th>
<th class="head"><p>len</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">+</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">+</span> <span class="pre">right[i]</span></code></p></td>
</tr>
<tr class="row-even"><td><p>N</p></td>
<td><p>1</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">+</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>M</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">+</span> <span class="pre">right[i]</span></code></p></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.__eq__">
<code class="sig-name descname">__eq__</code><span class="sig-paren">(</span><em class="sig-param">right</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SE2.__eq__" title="Permalink to this definition">¶</a></dt>
<dd><p>Overloaded <code class="docutils literal notranslate"><span class="pre">==</span></code> operator (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>left</strong> – left side of comparison</p></li>
<li><p><strong>right</strong> – right side of comparison</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>poses are equal</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
<p>Test two poses for equality</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">==</span> <span class="pre">Y</span></code> is true of the poses are of the same type and numerically
equal.</p></li>
</ul>
<p>If either operand contains a sequence the results is a sequence 
according to:</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 16%" />
<col style="width: 18%" />
<col style="width: 7%" />
<col style="width: 58%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>len(left)</p></th>
<th class="head"><p>len(right)</p></th>
<th class="head"><p>len</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">ret</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">==</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">ret[i]</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">==</span> <span class="pre">right[i]</span></code></p></td>
</tr>
<tr class="row-even"><td><p>N</p></td>
<td><p>1</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">ret[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">==</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>M</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">ret[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">==</span> <span class="pre">right[i]</span></code></p></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.__mul__">
<code class="sig-name descname">__mul__</code><span class="sig-paren">(</span><em class="sig-param">right</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SE2.__mul__" title="Permalink to this definition">¶</a></dt>
<dd><p>Overloaded <code class="docutils literal notranslate"><span class="pre">*</span></code> operator (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>left</strong> – left multiplicand</p></li>
<li><p><strong>right</strong> – right multiplicand</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>product</p>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p>ValueError</p>
</dd>
</dl>
<p>Pose composition, scaling or vector transformation:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">*</span> <span class="pre">Y</span></code> compounds the poses <code class="docutils literal notranslate"><span class="pre">X</span></code> and <code class="docutils literal notranslate"><span class="pre">Y</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">*</span> <span class="pre">s</span></code> performs elementwise multiplication of the elements of <code class="docutils literal notranslate"><span class="pre">X</span></code> by <code class="docutils literal notranslate"><span class="pre">s</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">s</span> <span class="pre">*</span> <span class="pre">X</span></code> performs elementwise multiplication of the elements of <code class="docutils literal notranslate"><span class="pre">X</span></code> by <code class="docutils literal notranslate"><span class="pre">s</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">*</span> <span class="pre">v</span></code> linear transform of the vector <code class="docutils literal notranslate"><span class="pre">v</span></code></p></li>
</ul>
<table class="docutils align-default">
<colgroup>
<col style="width: 23%" />
<col style="width: 23%" />
<col style="width: 18%" />
<col style="width: 36%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head" colspan="2"><p>Multiplicands</p></th>
<th class="head" colspan="2"><p>Product</p></th>
</tr>
<tr class="row-even"><th class="head"><p>left</p></th>
<th class="head"><p>right</p></th>
<th class="head"><p>type</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-odd"><td><p>Pose</p></td>
<td><p>Pose</p></td>
<td><p>Pose</p></td>
<td><p>matrix product</p></td>
</tr>
<tr class="row-even"><td><p>Pose</p></td>
<td><p>scalar</p></td>
<td><p>NxN matrix</p></td>
<td><p>element-wise product</p></td>
</tr>
<tr class="row-odd"><td><p>scalar</p></td>
<td><p>Pose</p></td>
<td><p>NxN matrix</p></td>
<td><p>element-wise product</p></td>
</tr>
<tr class="row-even"><td><p>Pose</p></td>
<td><p>N-vector</p></td>
<td><p>N-vector</p></td>
<td><p>vector transform</p></td>
</tr>
<tr class="row-odd"><td><p>Pose</p></td>
<td><p>NxM matrix</p></td>
<td><p>NxM matrix</p></td>
<td><p>transform each column</p></td>
</tr>
</tbody>
</table>
<p>Notes:</p>
<ol class="arabic simple">
<li><p>Pose is <code class="docutils literal notranslate"><span class="pre">SO2</span></code>, <code class="docutils literal notranslate"><span class="pre">SE2</span></code>, <code class="docutils literal notranslate"><span class="pre">SO3</span></code> or <code class="docutils literal notranslate"><span class="pre">SE3</span></code> instance</p></li>
<li><p>N is 2 for <code class="docutils literal notranslate"><span class="pre">SO2</span></code>, <code class="docutils literal notranslate"><span class="pre">SE2</span></code>; 3 for <code class="docutils literal notranslate"><span class="pre">SO3</span></code> or <code class="docutils literal notranslate"><span class="pre">SE3</span></code></p></li>
<li><p>scalar x Pose is handled by <code class="docutils literal notranslate"><span class="pre">__rmul__</span></code></p></li>
<li><p>scalar multiplication is commutative but the result is not a group
operation so the result will be a matrix</p></li>
<li><p>Any other input combinations result in a ValueError.</p></li>
</ol>
<p>For pose composition the <code class="docutils literal notranslate"><span class="pre">left</span></code> and <code class="docutils literal notranslate"><span class="pre">right</span></code> operands may be a sequence</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 16%" />
<col style="width: 18%" />
<col style="width: 7%" />
<col style="width: 58%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>len(left)</p></th>
<th class="head"><p>len(right)</p></th>
<th class="head"><p>len</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">*</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">*</span> <span class="pre">right[i]</span></code></p></td>
</tr>
<tr class="row-even"><td><p>N</p></td>
<td><p>1</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">*</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>M</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">*</span> <span class="pre">right[i]</span></code></p></td>
</tr>
</tbody>
</table>
<p>For vector transformation there are three cases</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 18%" />
<col style="width: 22%" />
<col style="width: 10%" />
<col style="width: 51%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head" colspan="2"><p>Multiplicands</p></th>
<th class="head" colspan="2"><p>Product</p></th>
</tr>
<tr class="row-even"><th class="head"><p>len(left)</p></th>
<th class="head"><p>right.shape</p></th>
<th class="head"><p>shape</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-odd"><td><p>1</p></td>
<td><p>(N,)</p></td>
<td><p>(N,)</p></td>
<td><p>vector transformation</p></td>
</tr>
<tr class="row-even"><td><p>M</p></td>
<td><p>(N,)</p></td>
<td><p>(N,M)</p></td>
<td><p>vector transformations</p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>(N,M)</p></td>
<td><p>(N,M)</p></td>
<td><p>column transformation</p></td>
</tr>
</tbody>
</table>
<p>Notes:</p>
<ol class="arabic simple">
<li><p>for the <code class="docutils literal notranslate"><span class="pre">SE2</span></code> and <code class="docutils literal notranslate"><span class="pre">SE3</span></code> case the vectors are converted to homogeneous
form, transformed, then converted back to Euclidean form.</p></li>
</ol>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.__ne__">
<code class="sig-name descname">__ne__</code><span class="sig-paren">(</span><em class="sig-param">right</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SE2.__ne__" title="Permalink to this definition">¶</a></dt>
<dd><p>Overloaded <code class="docutils literal notranslate"><span class="pre">!=</span></code> operator</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>left</strong> – left side of comparison</p></li>
<li><p><strong>right</strong> – right side of comparison</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>poses are not equal</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
<p>Test two poses for inequality</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">==</span> <span class="pre">Y</span></code> is true of the poses are of the same type but not numerically
equal.</p></li>
</ul>
<p>If either operand contains a sequence the results is a sequence 
according to:</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 16%" />
<col style="width: 18%" />
<col style="width: 7%" />
<col style="width: 58%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>len(left)</p></th>
<th class="head"><p>len(right)</p></th>
<th class="head"><p>len</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">ret</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">!=</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">ret[i]</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">!=</span> <span class="pre">right[i]</span></code></p></td>
</tr>
<tr class="row-even"><td><p>N</p></td>
<td><p>1</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">ret[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">!=</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>M</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">ret[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">!=</span> <span class="pre">right[i]</span></code></p></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.__pow__">
<code class="sig-name descname">__pow__</code><span class="sig-paren">(</span><em class="sig-param">n</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SE2.__pow__" title="Permalink to this definition">¶</a></dt>
<dd><p>Overloaded <code class="docutils literal notranslate"><span class="pre">**</span></code> operator (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>n</strong> – pose</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>pose to the power n</p>
</dd>
</dl>
<p>Raise all elements of pose to the specified power.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X**n</span></code> raise all values in <code class="docutils literal notranslate"><span class="pre">X</span></code> to the power <code class="docutils literal notranslate"><span class="pre">n</span></code></p></li>
</ul>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.__sub__">
<code class="sig-name descname">__sub__</code><span class="sig-paren">(</span><em class="sig-param">right</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SE2.__sub__" title="Permalink to this definition">¶</a></dt>
<dd><p>Overloaded <code class="docutils literal notranslate"><span class="pre">-</span></code> operator (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>left</strong> – left minuend</p></li>
<li><p><strong>right</strong> – right subtrahend</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>difference</p>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><strong>ValueError</strong> – for incompatible arguments</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy ndarray, shape=(N,N)</p>
</dd>
</dl>
<p>Subtract elements of two poses.  This is not a group operation so the
result is a matrix not a pose class.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">-</span> <span class="pre">Y</span></code> is the element-wise difference of the matrix value of <code class="docutils literal notranslate"><span class="pre">X</span></code> and <code class="docutils literal notranslate"><span class="pre">Y</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">-</span> <span class="pre">s</span></code> is the element-wise difference of the matrix value of <code class="docutils literal notranslate"><span class="pre">X</span></code> and <code class="docutils literal notranslate"><span class="pre">s</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">s</span> <span class="pre">-</span> <span class="pre">X</span></code> is the element-wise difference of <code class="docutils literal notranslate"><span class="pre">s</span></code> and the matrix value of <code class="docutils literal notranslate"><span class="pre">X</span></code></p></li>
</ul>
<table class="docutils align-default">
<colgroup>
<col style="width: 20%" />
<col style="width: 20%" />
<col style="width: 16%" />
<col style="width: 43%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head" colspan="2"><p>Operands</p></th>
<th class="head" colspan="2"><p>Sum</p></th>
</tr>
<tr class="row-even"><th class="head"><p>left</p></th>
<th class="head"><p>right</p></th>
<th class="head"><p>type</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-odd"><td><p>Pose</p></td>
<td><p>Pose</p></td>
<td><p>NxN matrix</p></td>
<td><p>element-wise matrix difference</p></td>
</tr>
<tr class="row-even"><td><p>Pose</p></td>
<td><p>scalar</p></td>
<td><p>NxN matrix</p></td>
<td><p>element-wise sum</p></td>
</tr>
<tr class="row-odd"><td><p>scalar</p></td>
<td><p>Pose</p></td>
<td><p>NxN matrix</p></td>
<td><p>element-wise sum</p></td>
</tr>
</tbody>
</table>
<p>Notes:</p>
<ol class="arabic simple">
<li><p>Pose is <code class="docutils literal notranslate"><span class="pre">SO2</span></code>, <code class="docutils literal notranslate"><span class="pre">SE2</span></code>, <code class="docutils literal notranslate"><span class="pre">SO3</span></code> or <code class="docutils literal notranslate"><span class="pre">SE3</span></code> instance</p></li>
<li><p>N is 2 for <code class="docutils literal notranslate"><span class="pre">SO2</span></code>, <code class="docutils literal notranslate"><span class="pre">SE2</span></code>; 3 for <code class="docutils literal notranslate"><span class="pre">SO3</span></code> or <code class="docutils literal notranslate"><span class="pre">SE3</span></code></p></li>
<li><p>scalar - Pose is handled by <code class="docutils literal notranslate"><span class="pre">__rsub__</span></code></p></li>
<li><p>Any other input combinations result in a ValueError.</p></li>
</ol>
<p>For pose addition the <code class="docutils literal notranslate"><span class="pre">left</span></code> and <code class="docutils literal notranslate"><span class="pre">right</span></code> operands may be a sequence which
results in the result being a sequence:</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 16%" />
<col style="width: 18%" />
<col style="width: 7%" />
<col style="width: 58%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>len(left)</p></th>
<th class="head"><p>len(right)</p></th>
<th class="head"><p>len</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">-</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">-</span> <span class="pre">right[i]</span></code></p></td>
</tr>
<tr class="row-even"><td><p>N</p></td>
<td><p>1</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">-</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>M</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span>&#160; <span class="pre">right[i]</span></code></p></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.__truediv__">
<code class="sig-name descname">__truediv__</code><span class="sig-paren">(</span><em class="sig-param">right</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SE2.__truediv__" title="Permalink to this definition">¶</a></dt>
<dd><p>Overloaded <code class="docutils literal notranslate"><span class="pre">/</span></code> operator (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>left</strong> – left multiplicand</p></li>
<li><p><strong>right</strong> – right multiplicand</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>product</p>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><strong>ValueError</strong> – for incompatible arguments</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy ndarray</p>
</dd>
</dl>
<p>Pose composition or scaling:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">/</span> <span class="pre">Y</span></code> compounds the poses <code class="docutils literal notranslate"><span class="pre">X</span></code> and <code class="docutils literal notranslate"><span class="pre">Y.inv()</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">/</span> <span class="pre">s</span></code> performs elementwise multiplication of the elements of <code class="docutils literal notranslate"><span class="pre">X</span></code> by <code class="docutils literal notranslate"><span class="pre">s</span></code></p></li>
</ul>
<table class="docutils align-default">
<colgroup>
<col style="width: 22%" />
<col style="width: 22%" />
<col style="width: 17%" />
<col style="width: 39%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head" colspan="2"><p>Multiplicands</p></th>
<th class="head" colspan="2"><p>Quotient</p></th>
</tr>
<tr class="row-even"><th class="head"><p>left</p></th>
<th class="head"><p>right</p></th>
<th class="head"><p>type</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-odd"><td><p>Pose</p></td>
<td><p>Pose</p></td>
<td><p>Pose</p></td>
<td><p>matrix product by inverse</p></td>
</tr>
<tr class="row-even"><td><p>Pose</p></td>
<td><p>scalar</p></td>
<td><p>NxN matrix</p></td>
<td><p>element-wise division</p></td>
</tr>
</tbody>
</table>
<p>Notes:</p>
<ol class="arabic simple">
<li><p>Pose is <code class="docutils literal notranslate"><span class="pre">SO2</span></code>, <code class="docutils literal notranslate"><span class="pre">SE2</span></code>, <code class="docutils literal notranslate"><span class="pre">SO3</span></code> or <code class="docutils literal notranslate"><span class="pre">SE3</span></code> instance</p></li>
<li><p>N is 2 for <code class="docutils literal notranslate"><span class="pre">SO2</span></code>, <code class="docutils literal notranslate"><span class="pre">SE2</span></code>; 3 for <code class="docutils literal notranslate"><span class="pre">SO3</span></code> or <code class="docutils literal notranslate"><span class="pre">SE3</span></code></p></li>
<li><p>scalar multiplication is not a group operation so the result will 
be a matrix</p></li>
<li><p>Any other input combinations result in a ValueError.</p></li>
</ol>
<p>For pose composition the <code class="docutils literal notranslate"><span class="pre">left</span></code> and <code class="docutils literal notranslate"><span class="pre">right</span></code> operands may be a sequence</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 15%" />
<col style="width: 16%" />
<col style="width: 7%" />
<col style="width: 62%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>len(left)</p></th>
<th class="head"><p>len(right)</p></th>
<th class="head"><p>len</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">*</span> <span class="pre">right.inv()</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">*</span> <span class="pre">right[i].inv()</span></code></p></td>
</tr>
<tr class="row-even"><td><p>N</p></td>
<td><p>1</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">*</span> <span class="pre">right.inv()</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>M</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">*</span> <span class="pre">right[i].inv()</span></code></p></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.about">
<em class="property">property </em><code class="sig-name descname">about</code><a class="headerlink" href="#spatialmath.pose2d.SE2.about" title="Permalink to this definition">¶</a></dt>
<dd><p>Succinct summary of object type and length (superclass property)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>succinct summary</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>str</p>
</dd>
</dl>
<p>Displays the type and the number of elements in compact form, for 
example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">([</span><span class="n">SE3</span><span class="p">()</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">20</span><span class="p">)])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">20</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">x</span><span class="o">.</span><span class="n">about</span><span class="p">)</span>
<span class="go">SE3[20]</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.animate">
<code class="sig-name descname">animate</code><span class="sig-paren">(</span><em class="sig-param">*args</em>, <em class="sig-param">T0=None</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SE2.animate" title="Permalink to this definition">¶</a></dt>
<dd><p>Plot pose object as an animated coordinate frame (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>**kwargs</strong> – plotting options</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X.plot()</span></code> displays the pose <code class="docutils literal notranslate"><span class="pre">X</span></code> as a coordinate frame moving
from the origin, or <code class="docutils literal notranslate"><span class="pre">T0</span></code>, in either 2D or 3D axes.  There are 
many options, see the links below.</p></li>
</ul>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">X</span> <span class="o">=</span> <span class="n">SE3</span><span class="o">.</span><span class="n">Rx</span><span class="p">(</span><span class="mf">0.3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">X</span><span class="o">.</span><span class="n">animate</span><span class="p">(</span><span class="n">frame</span><span class="o">=</span><span class="s1">&#39;A&#39;</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s1">&#39;green&#39;</span><span class="p">)</span>
</pre></div>
</div>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.tranimate" title="spatialmath.base.transforms3d.tranimate"><code class="xref py py-func docutils literal notranslate"><span class="pre">tranimate()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms2d.tranimate2" title="spatialmath.base.transforms2d.tranimate2"><code class="xref py py-func docutils literal notranslate"><span class="pre">tranimate2()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.append">
<code class="sig-name descname">append</code><span class="sig-paren">(</span><em class="sig-param">x</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SE2.append" title="Permalink to this definition">¶</a></dt>
<dd><p>Append a value to a pose object (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>x</strong> (<a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2"><em>SO2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><em>SE2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3"><em>SO3</em></a><em>, </em><em>SE3 instance</em>) – the value to append</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>ValueError</strong> – incorrect type of appended object</p>
</dd>
</dl>
<p>Appends the argument to the object’s internal list of values.</p>
<p>Examples:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">SE3</span><span class="o">.</span><span class="n">Rx</span><span class="p">(</span><span class="mf">0.1</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">2</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.clear">
<code class="sig-name descname">clear</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None -- remove all items from S<a class="headerlink" href="#spatialmath.pose2d.SE2.clear" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.extend">
<code class="sig-name descname">extend</code><span class="sig-paren">(</span><em class="sig-param">x</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SE2.extend" title="Permalink to this definition">¶</a></dt>
<dd><p>Extend sequence of values of a pose object (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>x</strong> (<a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2"><em>SO2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><em>SE2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3"><em>SO3</em></a><em>, </em><em>SE3 instance</em>) – the value to extend</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>ValueError</strong> – incorrect type of appended object</p>
</dd>
</dl>
<p>Appends the argument to the object’s internal list of values.</p>
<p>Examples:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">SE3</span><span class="o">.</span><span class="n">Rx</span><span class="p">(</span><span class="mf">0.1</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">2</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.insert">
<code class="sig-name descname">insert</code><span class="sig-paren">(</span><em class="sig-param">i</em>, <em class="sig-param">value</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SE2.insert" title="Permalink to this definition">¶</a></dt>
<dd><p>Insert a value to a pose object (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>i</strong> (<em>int</em>) – element to insert value before</p></li>
<li><p><strong>value</strong> (<a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2"><em>SO2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><em>SE2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3"><em>SO3</em></a><em>, </em><em>SE3 instance</em>) – the value to insert</p></li>
</ul>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>ValueError</strong> – incorrect type of inserted value</p>
</dd>
</dl>
<p>Inserts the argument into the object’s internal list of values.</p>
<p>Examples:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">inert</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">SE3</span><span class="o">.</span><span class="n">Rx</span><span class="p">(</span><span class="mf">0.1</span><span class="p">))</span> <span class="c1"># insert at position 0 in the list</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">2</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.interp">
<code class="sig-name descname">interp</code><span class="sig-paren">(</span><em class="sig-param">s=None</em>, <em class="sig-param">T0=None</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SE2.interp" title="Permalink to this definition">¶</a></dt>
<dd><p>Interpolate pose (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>T0</strong> (<a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2"><em>SO2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><em>SE2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3"><em>SO3</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SE3" title="spatialmath.pose3d.SE3"><em>SE3</em></a>) – initial pose</p></li>
<li><p><strong>s</strong> (<em>float</em><em> or </em><em>array_like</em>) – interpolation coefficient, range 0 to 1</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>interpolated pose</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2">SO2</a>, <a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2">SE2</a>, <a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3">SO3</a>, SE3 instance</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X.interp(s)</span></code> interpolates the pose X between identity when s=0
and X when s=1.</p></li>
</ul>
<blockquote>
<div><table class="docutils align-default">
<colgroup>
<col style="width: 11%" />
<col style="width: 11%" />
<col style="width: 20%" />
<col style="width: 57%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>len(X)</p></th>
<th class="head"><p>len(s)</p></th>
<th class="head"><p>len(result)</p></th>
<th class="head"><p>Result</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p>Y = interp(identity, X, s)</p></td>
</tr>
<tr class="row-odd"><td><p>M</p></td>
<td><p>1</p></td>
<td><p>M</p></td>
<td><p>Y[i] = interp(T0, X[i], s)</p></td>
</tr>
<tr class="row-even"><td><p>1</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p>Y[i] = interp(T0, X, s[i])</p></td>
</tr>
</tbody>
</table>
</div></blockquote>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="o">.</span><span class="n">Rx</span><span class="p">(</span><span class="mf">0.3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">x</span><span class="o">.</span><span class="n">interp</span><span class="p">(</span><span class="mi">0</span><span class="p">))</span>
<span class="go">SE3(array([[1., 0., 0., 0.],</span>
<span class="go">           [0., 1., 0., 0.],</span>
<span class="go">           [0., 0., 1., 0.],</span>
<span class="go">           [0., 0., 0., 1.]]))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">x</span><span class="o">.</span><span class="n">interp</span><span class="p">(</span><span class="mi">1</span><span class="p">))</span>
<span class="go">SE3(array([[ 1.        ,  0.        ,  0.        ,  0.        ],</span>
<span class="go">           [ 0.        ,  0.95533649, -0.29552021,  0.        ],</span>
<span class="go">           [ 0.        ,  0.29552021,  0.95533649,  0.        ],</span>
<span class="go">           [ 0.        ,  0.        ,  0.        ,  1.        ]]))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span> <span class="o">=</span> <span class="n">x</span><span class="o">.</span><span class="n">interp</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">linspace</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">10</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">y</span><span class="p">)</span>
<span class="go">10</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span><span class="p">[</span><span class="mi">5</span><span class="p">]</span>
<span class="go">SE3(array([[ 1.        ,  0.        ,  0.        ,  0.        ],</span>
<span class="go">           [ 0.        ,  0.98614323, -0.16589613,  0.        ],</span>
<span class="go">           [ 0.        ,  0.16589613,  0.98614323,  0.        ],</span>
<span class="go">           [ 0.        ,  0.        ,  0.        ,  1.        ]]))</span>
</pre></div>
</div>
<p>Notes:</p>
<ol class="arabic simple">
<li><p>For SO3 and SE3 rotation is interpolated using quaternion spherical linear interpolation (slerp).</p></li>
</ol>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.trinterp" title="spatialmath.base.transforms3d.trinterp"><code class="xref py py-func docutils literal notranslate"><span class="pre">trinterp()</span></code></a>, <a class="reference internal" href="#spatialmath.base.quaternions.slerp" title="spatialmath.base.quaternions.slerp"><code class="xref py py-func docutils literal notranslate"><span class="pre">spatialmath.base.quaternions.slerp()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms2d.trinterp2" title="spatialmath.base.transforms2d.trinterp2"><code class="xref py py-func docutils literal notranslate"><span class="pre">trinterp2()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.isSE">
<em class="property">property </em><code class="sig-name descname">isSE</code><a class="headerlink" href="#spatialmath.pose2d.SE2.isSE" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if object belongs to SE(n) group (superclass property)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>self</strong> (<a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2"><em>SO2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><em>SE2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3"><em>SO3</em></a><em>, </em><em>SE3 instance</em>) – object to test</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">True</span></code> if object is instance of SE2 or SE3</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.isSO">
<em class="property">property </em><code class="sig-name descname">isSO</code><a class="headerlink" href="#spatialmath.pose2d.SE2.isSO" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if object belongs to SO(n) group (superclass property)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>self</strong> (<a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2"><em>SO2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><em>SE2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3"><em>SO3</em></a><em>, </em><em>SE3 instance</em>) – object to test</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">True</span></code> if object is instance of SO2 or SO3</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.ishom">
<code class="sig-name descname">ishom</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SE2.ishom" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if object belongs to SE(3) group (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">True</span></code> if object is instance of SE3</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>bool</p>
</dd>
</dl>
<p>For compatibility with Spatial Math Toolbox for MATLAB.
In Python use <code class="docutils literal notranslate"><span class="pre">isinstance(x,</span> <span class="pre">SE3)</span></code>.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SO3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">isrot</span><span class="p">()</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">isrot</span><span class="p">()</span>
<span class="go">True</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.ishom2">
<code class="sig-name descname">ishom2</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SE2.ishom2" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if object belongs to SE(2) group (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">True</span></code> if object is instance of SE2</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>bool</p>
</dd>
</dl>
<p>For compatibility with Spatial Math Toolbox for MATLAB.
In Python use <code class="docutils literal notranslate"><span class="pre">isinstance(x,</span> <span class="pre">SE2)</span></code>.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SO2</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">isrot</span><span class="p">()</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE2</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">isrot</span><span class="p">()</span>
<span class="go">True</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.isrot">
<code class="sig-name descname">isrot</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SE2.isrot" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if object belongs to SO(3) group (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">True</span></code> if object is instance of SO3</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>bool</p>
</dd>
</dl>
<p>For compatibility with Spatial Math Toolbox for MATLAB.
In Python use <code class="docutils literal notranslate"><span class="pre">isinstance(x,</span> <span class="pre">SO3)</span></code>.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SO3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">isrot</span><span class="p">()</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">isrot</span><span class="p">()</span>
<span class="go">False</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.isrot2">
<code class="sig-name descname">isrot2</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SE2.isrot2" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if object belongs to SO(2) group (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">True</span></code> if object is instance of SO2</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>bool</p>
</dd>
</dl>
<p>For compatibility with Spatial Math Toolbox for MATLAB.
In Python use <code class="docutils literal notranslate"><span class="pre">isinstance(x,</span> <span class="pre">SO2)</span></code>.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SO2</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">isrot</span><span class="p">()</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE2</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">isrot</span><span class="p">()</span>
<span class="go">False</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.log">
<code class="sig-name descname">log</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SE2.log" title="Permalink to this definition">¶</a></dt>
<dd><p>Logarithm of pose (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>logarithm</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>numpy.ndarray</p>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p>ValueError</p>
</dd>
</dl>
<p>An efficient closed-form solution of the matrix logarithm.</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 12%" />
<col style="width: 14%" />
<col style="width: 74%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Input</p></th>
<th class="head" colspan="2"><p>Output</p></th>
</tr>
<tr class="row-even"><th class="head"><p>Pose</p></th>
<th class="head"><p>Shape</p></th>
<th class="head"><p>Structure</p></th>
</tr>
</thead>
<tbody>
<tr class="row-odd"><td><p>SO2</p></td>
<td><p>(2,2)</p></td>
<td><p>skew-symmetric</p></td>
</tr>
<tr class="row-even"><td><p>SE2</p></td>
<td><p>(3,3)</p></td>
<td><p>augmented skew-symmetric</p></td>
</tr>
<tr class="row-odd"><td><p>SO3</p></td>
<td><p>(3,3)</p></td>
<td><p>skew-symmetric</p></td>
</tr>
<tr class="row-even"><td><p>SE3</p></td>
<td><p>(4,4)</p></td>
<td><p>augmented skew-symmetric</p></td>
</tr>
</tbody>
</table>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="o">.</span><span class="n">Rx</span><span class="p">(</span><span class="mf">0.3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span> <span class="o">=</span> <span class="n">x</span><span class="o">.</span><span class="n">log</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span>
<span class="go">array([[ 0. , -0. ,  0. ,  0. ],</span>
<span class="go">       [ 0. ,  0. , -0.3,  0. ],</span>
<span class="go">       [-0. ,  0.3,  0. ,  0. ],</span>
<span class="go">       [ 0. ,  0. ,  0. ,  0. ]])</span>
</pre></div>
</div>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms2d.trlog2" title="spatialmath.base.transforms2d.trlog2"><code class="xref py py-func docutils literal notranslate"><span class="pre">trlog2()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms3d.trlog" title="spatialmath.base.transforms3d.trlog"><code class="xref py py-func docutils literal notranslate"><span class="pre">trlog()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.norm">
<code class="sig-name descname">norm</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SE2.norm" title="Permalink to this definition">¶</a></dt>
<dd><p>Normalize pose (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>pose</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2">SO2</a>, <a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2">SE2</a>, <a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3">SO3</a>, SE3 instance</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X.norm()</span></code> is an equivalent pose object but the rotational matrix 
part of all values has been adjusted to ensure it is a proper orthogonal
matrix rotation.</p></li>
</ul>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span> <span class="o">=</span> <span class="n">x</span><span class="o">.</span><span class="n">norm</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span>
<span class="go">SE3(array([[1., 0., 0., 0.],</span>
<span class="go">           [0., 1., 0., 0.],</span>
<span class="go">           [0., 0., 1., 0.],</span>
<span class="go">           [0., 0., 0., 1.]]))</span>
</pre></div>
</div>
<p>Notes:</p>
<ol class="arabic simple">
<li><p>Only the direction of A vector (the z-axis) is unchanged.</p></li>
<li><p>Used to prevent finite word length arithmetic causing transforms to 
become ‘unnormalized’.</p></li>
</ol>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.trnorm" title="spatialmath.base.transforms3d.trnorm"><code class="xref py py-func docutils literal notranslate"><span class="pre">trnorm()</span></code></a>, <code class="xref py py-func docutils literal notranslate"><span class="pre">trnorm2()</span></code></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.plot">
<code class="sig-name descname">plot</code><span class="sig-paren">(</span><em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SE2.plot" title="Permalink to this definition">¶</a></dt>
<dd><p>Plot pose object as a coordinate frame (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>**kwargs</strong> – plotting options</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X.plot()</span></code> displays the pose <code class="docutils literal notranslate"><span class="pre">X</span></code> as a coordinate frame in either
2D or 3D axes.  There are many options, see the links below.</p></li>
</ul>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">X</span> <span class="o">=</span> <span class="n">SE3</span><span class="o">.</span><span class="n">Rx</span><span class="p">(</span><span class="mf">0.3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">X</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">frame</span><span class="o">=</span><span class="s1">&#39;A&#39;</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s1">&#39;green&#39;</span><span class="p">)</span>
</pre></div>
</div>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.trplot" title="spatialmath.base.transforms3d.trplot"><code class="xref py py-func docutils literal notranslate"><span class="pre">trplot()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms2d.trplot2" title="spatialmath.base.transforms2d.trplot2"><code class="xref py py-func docutils literal notranslate"><span class="pre">trplot2()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.pop">
<code class="sig-name descname">pop</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SE2.pop" title="Permalink to this definition">¶</a></dt>
<dd><p>Pop value of a pose object (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>the specific element of the pose</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2">SO2</a>, <a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2">SE2</a>, <a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3">SO3</a>, SE3 instance</p>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><strong>IndexError</strong> – if there are no values to pop</p>
</dd>
</dl>
<p>Removes the first pose value from the sequence in the pose object.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="o">.</span><span class="n">Rx</span><span class="p">([</span><span class="mi">0</span><span class="p">,</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="o">/</span><span class="mi">2</span><span class="p">,</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">3</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span> <span class="o">=</span> <span class="n">x</span><span class="o">.</span><span class="n">pop</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span>
<span class="go">SE3(array([[ 1.0000000e+00,  0.0000000e+00,  0.0000000e+00,  0.0000000e+00],</span>
<span class="go">           [ 0.0000000e+00, -1.0000000e+00, -1.2246468e-16,  0.0000000e+00],</span>
<span class="go">           [ 0.0000000e+00,  1.2246468e-16, -1.0000000e+00,  0.0000000e+00],</span>
<span class="go">           [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00,  1.0000000e+00]]))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">2</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.printline">
<code class="sig-name descname">printline</code><span class="sig-paren">(</span><em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SE2.printline" title="Permalink to this definition">¶</a></dt>
<dd><p>Print pose as a single line (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>label</strong> (<em>str</em>) – text label to put at start of line</p></li>
<li><p><strong>file</strong> (<em>str</em>) – file to write formatted string to. [default, stdout]</p></li>
<li><p><strong>fmt</strong> (<em>str</em>) – conversion format for each number as used by <code class="docutils literal notranslate"><span class="pre">format()</span></code></p></li>
<li><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>optional formatted string</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
<p>For SO(3) or SE(3) also:</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>orient</strong> (<em>str</em>) – 3-angle convention to use</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X.printline()</span></code> print <code class="docutils literal notranslate"><span class="pre">X</span></code> in single-line format to <code class="docutils literal notranslate"><span class="pre">stdout</span></code>, followed
by a newline</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">X.printline(file=None)</span></code> return a string containing <code class="docutils literal notranslate"><span class="pre">X</span></code> in 
single-line format</p></li>
</ul>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">=</span><span class="n">SE3</span><span class="o">.</span><span class="n">Rx</span><span class="p">(</span><span class="mf">0.3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">printline</span><span class="p">()</span>
<span class="go">t =        0,        0,        0; rpy/zyx =       17,        0,        0 deg</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.reverse">
<code class="sig-name descname">reverse</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SE2.reverse" title="Permalink to this definition">¶</a></dt>
<dd><p>S.reverse() – reverse <em>IN PLACE</em></p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.shape">
<em class="property">property </em><code class="sig-name descname">shape</code><a class="headerlink" href="#spatialmath.pose2d.SE2.shape" title="Permalink to this definition">¶</a></dt>
<dd><p>Shape of the object’s matrix representation (superclass property)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>matrix shape</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>2-tuple of ints</p>
</dd>
</dl>
<p>(2,2) for <code class="docutils literal notranslate"><span class="pre">SO2</span></code>, (3,3) for <code class="docutils literal notranslate"><span class="pre">SE2</span></code> and <code class="docutils literal notranslate"><span class="pre">SO3</span></code>, and (4,4) for <code class="docutils literal notranslate"><span class="pre">SE3</span></code>.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">shape</span>
<span class="go">(4, 4)</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.t">
<em class="property">property </em><code class="sig-name descname">t</code><a class="headerlink" href="#spatialmath.pose2d.SE2.t" title="Permalink to this definition">¶</a></dt>
<dd><p>Translational component of SE(2)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>self</strong> (<em>SE2 instance</em>) – SE(2)</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>translational component</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">x.t</span></code> is the translational vector component.  If <code class="docutils literal notranslate"><span class="pre">len(x)</span></code> is:</p>
<ul class="simple">
<li><p>1, return an ndarray with shape=(2,)</p></li>
<li><p>N&gt;1, return an ndarray with shape=(N,2)</p></li>
</ul>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.theta">
<code class="sig-name descname">theta</code><span class="sig-paren">(</span><em class="sig-param">units='rad'</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose2d.SE2.theta" title="Permalink to this definition">¶</a></dt>
<dd><p>SO(2) as a rotation angle</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>unit</strong> (<em>str</em><em>, </em><em>optional</em>) – angular units ‘deg’ or ‘rad’ [default]</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>rotation angle</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>float or list</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">x.theta</span></code> is the rotation angle such that <cite>x</cite> is <cite>SO2(x.theta)</cite>.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.xyt">
<code class="sig-name descname">xyt</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose2d.html#SE2.xyt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose2d.SE2.xyt" title="Permalink to this definition">¶</a></dt>
<dd><p>SE(2) as a configuration vector</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>An array <span class="math notranslate nohighlight">\([x, y, \theta]\)</span></p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>numpy.ndarray</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">x.xyt</span></code> is the rigidbody motion in minimal form as a translation and rotation expressed 
in vector form as <span class="math notranslate nohighlight">\([x, y, \theta]\)</span>.  If <code class="docutils literal notranslate"><span class="pre">len(x)</span></code> is:</p>
<ul class="simple">
<li><p>1, return an ndarray with shape=(3,)</p></li>
<li><p>N&gt;1, return an ndarray with shape=(N,3)</p></li>
</ul>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.inv">
<code class="sig-name descname">inv</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose2d.html#SE2.inv"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose2d.SE2.inv" title="Permalink to this definition">¶</a></dt>
<dd><p>Inverse of SE(2)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>self</strong> (<em>SE2 instance</em>) – pose</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>inverse</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2">SE2</a></p>
</dd>
</dl>
<p>Notes:</p>
<blockquote>
<div><ul class="simple">
<li><p>for elements of SE(2) this takes into account the matrix structure <span class="math notranslate nohighlight">\(T^{-1} = \left[ \begin{array}{cc} R &amp; t \\ 0 &amp; 1 \end{array} \right], T^{-1} = \left[ \begin{array}{cc} R^T &amp; -R^T t \\ 0 &amp; 1 \end{array} \right]\)</span></p></li>
<li><p>if <cite>x</cite> contains a sequence, returns an <cite>SE2</cite> with a sequence of inverses</p></li>
</ul>
</div></blockquote>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose2d.SE2.SE3">
<code class="sig-name descname">SE3</code><span class="sig-paren">(</span><em class="sig-param">z=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose2d.html#SE2.SE3"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose2d.SE2.SE3" title="Permalink to this definition">¶</a></dt>
<dd><p>Create SE(3) from SE(2)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>z</strong> (<em>float</em>) – default z coordinate, defaults to 0</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>SE(2) with same rotation but zero translation</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>SE2 instance</p>
</dd>
</dl>
<p>“Lifts” 2D rigid-body motion to 3D, rotation in the xy-plane (about the z-axis) and
z-coordinate is settable.</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-spatialmath.pose3d">
<span id="pose-in-3d"></span><h3>Pose in 3D<a class="headerlink" href="#module-spatialmath.pose3d" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="spatialmath.pose3d.SO3">
<em class="property">class </em><code class="sig-prename descclassname">spatialmath.pose3d.</code><code class="sig-name descname">SO3</code><span class="sig-paren">(</span><em class="sig-param">arg=None</em>, <em class="sig-param">*</em>, <em class="sig-param">check=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose3d.html#SO3"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose3d.SO3" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">spatialmath.super_pose.SMPose</span></code></p>
<p>SO(3) subclass</p>
<p>This subclass represents rotations in 3D space.  Internally it is a 3x3 orthogonal matrix belonging
to the group SO(3).</p>
<dl class="method">
<dt id="spatialmath.pose3d.SO3.__init__">
<code class="sig-name descname">__init__</code><span class="sig-paren">(</span><em class="sig-param">arg=None</em>, <em class="sig-param">*</em>, <em class="sig-param">check=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose3d.html#SO3.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose3d.SO3.__init__" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct new SO(3) object</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">SO3()</span></code> is an SO3 instance representing null rotation – the identity matrix</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SO3(R)</span></code> is an SO3 instance with rotation matrix R which is a 3x3 numpy array representing an valid rotation matrix.  If <code class="docutils literal notranslate"><span class="pre">check</span></code>
is <code class="docutils literal notranslate"><span class="pre">True</span></code> check the matrix value.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SO3([R1,</span> <span class="pre">R2,</span> <span class="pre">...</span> <span class="pre">RN])</span></code> where each Ri is a 3x3 numpy array of rotation matrices, is
an SO3 instance containing N rotations. If <code class="docutils literal notranslate"><span class="pre">check</span></code> is <code class="docutils literal notranslate"><span class="pre">True</span></code>
then each matrix is checked for validity.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SO3([X1,</span> <span class="pre">X2,</span> <span class="pre">...</span> <span class="pre">XN])</span></code> where each Xi is an SO3 instance, is an SO3 instance containing N rotations.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><cite>SMPose.pose_arghandler</cite></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.R">
<em class="property">property </em><code class="sig-name descname">R</code><a class="headerlink" href="#spatialmath.pose3d.SO3.R" title="Permalink to this definition">¶</a></dt>
<dd><p>SO(3) or SE(3) as rotation matrix</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>rotational component</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>numpy.ndarray, shape=(3,3)</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">x.R</span></code> returns the rotation matrix, when <cite>x</cite> is <cite>SO3</cite> or <cite>SE3</cite>. If <cite>len(x)</cite> is:</p>
<ul class="simple">
<li><p>1, return an ndarray with shape=(3,3)</p></li>
<li><p>N&gt;1, return ndarray with shape=(N,3,3)</p></li>
</ul>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.n">
<em class="property">property </em><code class="sig-name descname">n</code><a class="headerlink" href="#spatialmath.pose3d.SO3.n" title="Permalink to this definition">¶</a></dt>
<dd><p>Normal vector of SO(3) or SE(3)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>normal vector</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>numpy.ndarray, shape=(3,)</p>
</dd>
</dl>
<p>Is the first column of the rotation submatrix, sometimes called the normal
vector.  Parallel to the x-axis of the frame defined by this pose.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.o">
<em class="property">property </em><code class="sig-name descname">o</code><a class="headerlink" href="#spatialmath.pose3d.SO3.o" title="Permalink to this definition">¶</a></dt>
<dd><p>Orientation vector of SO(3) or SE(3)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>orientation vector</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>numpy.ndarray, shape=(3,)</p>
</dd>
</dl>
<p>Is the second column of the rotation submatrix, sometimes called the orientation
vector.  Parallel to the y-axis of the frame defined by this pose.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.a">
<em class="property">property </em><code class="sig-name descname">a</code><a class="headerlink" href="#spatialmath.pose3d.SO3.a" title="Permalink to this definition">¶</a></dt>
<dd><p>Approach vector of SO(3) or SE(3)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>approach vector</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>numpy.ndarray, shape=(3,)</p>
</dd>
</dl>
<p>Is the third column of the rotation submatrix, sometimes called the approach
vector.  Parallel to the z-axis of the frame defined by this pose.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.inv">
<code class="sig-name descname">inv</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose3d.html#SO3.inv"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose3d.SO3.inv" title="Permalink to this definition">¶</a></dt>
<dd><p>Inverse of SO(3)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>self</strong> (<em>SE3 instance</em>) – pose</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>inverse</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2">SO2</a></p>
</dd>
</dl>
<p>Returns the inverse, which for elements of SO(3) is the transpose.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.eul">
<code class="sig-name descname">eul</code><span class="sig-paren">(</span><em class="sig-param">unit='deg'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose3d.html#SO3.eul"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose3d.SO3.eul" title="Permalink to this definition">¶</a></dt>
<dd><p>SO(3) or SE(3) as Euler angles</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>3-vector of Euler angles</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(3,)</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">x.eul</span></code> is the Euler angle representation of the rotation.  Euler angles are
a 3-vector <span class="math notranslate nohighlight">\((\phi,        heta, \psi)\)</span> which correspond to consecutive
rotations about the Z, Y, Z axes respectively.</p>
<p>If <cite>len(x)</cite> is:</p>
<ul class="simple">
<li><p>1, return an ndarray with shape=(3,)</p></li>
<li><p>N&gt;1, return ndarray with shape=(N,3)</p></li>
<li><p>ndarray with shape=(3,), if len(R) == 1</p></li>
<li><p>ndarray with shape=(N,3), if len(R) = N &gt; 1</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.pose3d.SE3.Eul" title="spatialmath.pose3d.SE3.Eul"><code class="xref py py-func docutils literal notranslate"><span class="pre">Eul()</span></code></a>, :<a class="reference internal" href="#spatialmath.base.transforms3d.tr2eul" title="spatialmath.base.transforms3d.tr2eul"><code class="xref py py-func docutils literal notranslate"><span class="pre">spatialmath.base.transforms3d.tr2eul()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.rpy">
<code class="sig-name descname">rpy</code><span class="sig-paren">(</span><em class="sig-param">unit='deg'</em>, <em class="sig-param">order='zyx'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose3d.html#SO3.rpy"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose3d.SO3.rpy" title="Permalink to this definition">¶</a></dt>
<dd><p>SO(3) or SE(3) as roll-pitch-yaw angles</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>order</strong> (<em>str</em>) – angle sequence order, default to ‘zyx’</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>3-vector of roll-pitch-yaw angles</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(3,)</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">x.rpy</span></code> is the roll-pitch-yaw angle representation of the rotation.  The angles are
a 3-vector <span class="math notranslate nohighlight">\((r, p, y)\)</span> which correspond to successive rotations about the axes
specified by <code class="docutils literal notranslate"><span class="pre">order</span></code>:</p>
<blockquote>
<div><ul class="simple">
<li><p>‘zyx’ [default], rotate by yaw about the z-axis, then by pitch about the new y-axis,
then by roll about the new x-axis.  Convention for a mobile robot with x-axis forward
and y-axis sideways.</p></li>
<li><p>‘xyz’, rotate by yaw about the x-axis, then by pitch about the new y-axis,
then by roll about the new z-axis. Covention for a robot gripper with z-axis forward
and y-axis between the gripper fingers.</p></li>
<li><p>‘yxz’, rotate by yaw about the y-axis, then by pitch about the new x-axis,
then by roll about the new z-axis. Convention for a camera with z-axis parallel
to the optic axis and x-axis parallel to the pixel rows.</p></li>
</ul>
</div></blockquote>
<p>If <cite>len(x)</cite> is:</p>
<ul class="simple">
<li><p>1, return an ndarray with shape=(3,)</p></li>
<li><p>N&gt;1, return ndarray with shape=(N,3)</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.pose3d.SE3.RPY" title="spatialmath.pose3d.SE3.RPY"><code class="xref py py-func docutils literal notranslate"><span class="pre">RPY()</span></code></a>, :<a class="reference internal" href="#spatialmath.base.transforms3d.tr2rpy" title="spatialmath.base.transforms3d.tr2rpy"><code class="xref py py-func docutils literal notranslate"><span class="pre">spatialmath.base.transforms3d.tr2rpy()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.Ad">
<code class="sig-name descname">Ad</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose3d.html#SO3.Ad"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose3d.SO3.Ad" title="Permalink to this definition">¶</a></dt>
<dd><p>Adjoint of SO(3)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>adjoint matrix</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>numpy.ndarray, shape=(6,6)</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">SE3.Ad</span></code> is the 6x6 adjoint matrix</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>Twist.ad.</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.isvalid">
<em class="property">static </em><code class="sig-name descname">isvalid</code><span class="sig-paren">(</span><em class="sig-param">x</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose3d.html#SO3.isvalid"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose3d.SO3.isvalid" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if matrix is valid SO(3)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>x</strong> (<em>numpy.ndarray</em>) – matrix to test</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>true if the matrix is a valid element of SO(3), ie. it is a 3x3
orthonormal matrix with determinant of +1.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
<dt class="field-even">Seealso</dt>
<dd class="field-even"><p><code class="xref py py-func docutils literal notranslate"><span class="pre">isrot()</span></code></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.Rx">
<em class="property">classmethod </em><code class="sig-name descname">Rx</code><span class="sig-paren">(</span><em class="sig-param">theta</em>, <em class="sig-param">unit='rad'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose3d.html#SO3.Rx"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose3d.SO3.Rx" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct a new SO(3) from X-axis rotation</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>theta</strong> (<em>float</em><em> or </em><em>array_like</em>) – rotation angle about the X-axis</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>SO(3) rotation</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>SO3 instance</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">SE3.Rx(theta)</span></code> is an SO(3) rotation of <code class="docutils literal notranslate"><span class="pre">theta</span></code> radians about the x-axis</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SE3.Rx(theta,</span> <span class="pre">&quot;deg&quot;)</span></code> as above but <code class="docutils literal notranslate"><span class="pre">theta</span></code> is in degrees</p></li>
</ul>
<p>If <code class="docutils literal notranslate"><span class="pre">theta</span></code> is an array then the result is a sequence of rotations defined by consecutive
elements.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SO3</span><span class="o">.</span><span class="n">Rx</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">linspace</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="p">,</span> <span class="mi">20</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">20</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">[</span><span class="mi">7</span><span class="p">]</span>
<span class="go">SO3(array([[ 1.        ,  0.        ,  0.        ],</span>
<span class="go">           [ 0.        ,  0.40169542, -0.91577333],</span>
<span class="go">           [ 0.        ,  0.91577333,  0.40169542]]))</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.Ry">
<em class="property">classmethod </em><code class="sig-name descname">Ry</code><span class="sig-paren">(</span><em class="sig-param">theta</em>, <em class="sig-param">unit='rad'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose3d.html#SO3.Ry"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose3d.SO3.Ry" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct a new SO(3) from Y-axis rotation</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>theta</strong> (<em>float</em><em> or </em><em>array_like</em>) – rotation angle about Y-axis</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>SO(3) rotation</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>SO3 instance</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">SO3.Ry(theta)</span></code> is an SO(3) rotation of <code class="docutils literal notranslate"><span class="pre">theta</span></code> radians about the y-axis</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SO3.Ry(theta,</span> <span class="pre">&quot;deg&quot;)</span></code> as above but <code class="docutils literal notranslate"><span class="pre">theta</span></code> is in degrees</p></li>
</ul>
<p>If <code class="docutils literal notranslate"><span class="pre">theta</span></code> is an array then the result is a sequence of rotations defined by consecutive
elements.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SO3</span><span class="o">.</span><span class="n">Ry</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">linspace</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="p">,</span> <span class="mi">20</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">20</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">[</span><span class="mi">7</span><span class="p">]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">[</span><span class="mi">7</span><span class="p">]</span>
<span class="go">SO3(array([[ 0.40169542,  0.        ,  0.91577333],</span>
<span class="go">           [ 0.        ,  1.        ,  0.        ],</span>
<span class="go">           [-0.91577333,  0.        ,  0.40169542]]))</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.Rz">
<em class="property">classmethod </em><code class="sig-name descname">Rz</code><span class="sig-paren">(</span><em class="sig-param">theta</em>, <em class="sig-param">unit='rad'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose3d.html#SO3.Rz"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose3d.SO3.Rz" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct a new SO(3) from Z-axis rotation</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>theta</strong> (<em>float</em><em> or </em><em>array_like</em>) – rotation angle about Z-axis</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>SO(3) rotation</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>SO3 instance</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">SO3.Rz(theta)</span></code> is an SO(3) rotation of <code class="docutils literal notranslate"><span class="pre">theta</span></code> radians about the z-axis</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SO3.Rz(theta,</span> <span class="pre">&quot;deg&quot;)</span></code> as above but <code class="docutils literal notranslate"><span class="pre">theta</span></code> is in degrees</p></li>
</ul>
<p>If <code class="docutils literal notranslate"><span class="pre">theta</span></code> is an array then the result is a sequence of rotations defined by consecutive
elements.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="o">.</span><span class="n">Rz</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">linspace</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="p">,</span> <span class="mi">20</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">20</span>
<span class="go">SO3(array([[ 0.40169542, -0.91577333,  0.        ],</span>
<span class="go">           [ 0.91577333,  0.40169542,  0.        ],</span>
<span class="go">           [ 0.        ,  0.        ,  1.        ]]))</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.Rand">
<em class="property">classmethod </em><code class="sig-name descname">Rand</code><span class="sig-paren">(</span><em class="sig-param">N=1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose3d.html#SO3.Rand"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose3d.SO3.Rand" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct a new SO(3) from random rotation</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>N</strong> (<em>int</em>) – number of random rotations</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>SO(3) rotation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>SO3 instance</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">SO3.Rand()</span></code> is a random SO(3) rotation.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SO3.Rand(N)</span></code> is a sequence of N random rotations.</p></li>
</ul>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SO3</span><span class="o">.</span><span class="n">Rand</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span>
<span class="go">SO3(array([[ 0.1805082 , -0.97959019,  0.08842995],</span>
<span class="go">           [-0.98357187, -0.17961408,  0.01803234],</span>
<span class="go">           [-0.00178104, -0.0902322 , -0.99591916]]))</span>
</pre></div>
</div>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.quaternion.UnitQuaternion.Rand" title="spatialmath.quaternion.UnitQuaternion.Rand"><code class="xref py py-func docutils literal notranslate"><span class="pre">spatialmath.quaternion.UnitQuaternion.Rand()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.Eul">
<em class="property">classmethod </em><code class="sig-name descname">Eul</code><span class="sig-paren">(</span><em class="sig-param">angles</em>, <em class="sig-param">*</em>, <em class="sig-param">unit='rad'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose3d.html#SO3.Eul"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose3d.SO3.Eul" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct a new SO(3) from Euler angles</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>angles</strong> (<em>array_like</em><em> or </em><em>numpy.ndarray with shape=</em><em>(</em><em>N</em><em>,</em><em>3</em><em>)</em>) – Euler angles</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>SO(3) rotation</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>SO3 instance</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">SO3.Eul(angles)</span></code> is an SO(3) rotation defined by a 3-vector of Euler angles <span class="math notranslate nohighlight">\((\phi, \theta, \psi)\)</span> which
correspond to consecutive rotations about the Z, Y, Z axes respectively.</p>
<p>If <code class="docutils literal notranslate"><span class="pre">angles</span></code> is an Nx3 matrix then the result is a sequence of rotations each defined by Euler angles
correponding to the rows of <code class="docutils literal notranslate"><span class="pre">angles</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.pose3d.SE3.eul" title="spatialmath.pose3d.SE3.eul"><code class="xref py py-func docutils literal notranslate"><span class="pre">eul()</span></code></a>, <a class="reference internal" href="#spatialmath.pose3d.SE3.Eul" title="spatialmath.pose3d.SE3.Eul"><code class="xref py py-func docutils literal notranslate"><span class="pre">Eul()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms3d.eul2r" title="spatialmath.base.transforms3d.eul2r"><code class="xref py py-func docutils literal notranslate"><span class="pre">spatialmath.base.transforms3d.eul2r()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.RPY">
<em class="property">classmethod </em><code class="sig-name descname">RPY</code><span class="sig-paren">(</span><em class="sig-param">angles</em>, <em class="sig-param">*</em>, <em class="sig-param">order='zyx'</em>, <em class="sig-param">unit='rad'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose3d.html#SO3.RPY"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose3d.SO3.RPY" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct a new SO(3) from roll-pitch-yaw angles</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>angles</strong> (<em>array_like</em><em> or </em><em>numpy.ndarray with shape=</em><em>(</em><em>N</em><em>,</em><em>3</em><em>)</em>) – roll-pitch-yaw angles</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p></li>
<li><p><strong>unit</strong> – rotation order: ‘zyx’ [default], ‘xyz’, or ‘yxz’</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>SO(3) rotation</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>SO3 instance</p>
</dd>
</dl>
<dl>
<dt><code class="docutils literal notranslate"><span class="pre">SO3.RPY(angles)</span></code> is an SO(3) rotation defined by a 3-vector of roll, pitch, yaw angles <span class="math notranslate nohighlight">\((r, p, y)\)</span></dt><dd><p>which correspond to successive rotations about the axes specified by <code class="docutils literal notranslate"><span class="pre">order</span></code>:</p>
<blockquote>
<div><ul class="simple">
<li><p>‘zyx’ [default], rotate by yaw about the z-axis, then by pitch about the new y-axis,
then by roll about the new x-axis.  Convention for a mobile robot with x-axis forward
and y-axis sideways.</p></li>
<li><p>‘xyz’, rotate by yaw about the x-axis, then by pitch about the new y-axis,
then by roll about the new z-axis. Covention for a robot gripper with z-axis forward
and y-axis between the gripper fingers.</p></li>
<li><p>‘yxz’, rotate by yaw about the y-axis, then by pitch about the new x-axis,
then by roll about the new z-axis. Convention for a camera with z-axis parallel
to the optic axis and x-axis parallel to the pixel rows.</p></li>
</ul>
</div></blockquote>
</dd>
</dl>
<p>If <code class="docutils literal notranslate"><span class="pre">angles</span></code> is an Nx3 matrix then the result is a sequence of rotations each defined by RPY angles
correponding to the rows of angles.</p>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.pose3d.SE3.rpy" title="spatialmath.pose3d.SE3.rpy"><code class="xref py py-func docutils literal notranslate"><span class="pre">rpy()</span></code></a>, <a class="reference internal" href="#spatialmath.pose3d.SE3.RPY" title="spatialmath.pose3d.SE3.RPY"><code class="xref py py-func docutils literal notranslate"><span class="pre">RPY()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms3d.rpy2r" title="spatialmath.base.transforms3d.rpy2r"><code class="xref py py-func docutils literal notranslate"><span class="pre">spatialmath.base.transforms3d.rpy2r()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.OA">
<em class="property">classmethod </em><code class="sig-name descname">OA</code><span class="sig-paren">(</span><em class="sig-param">o</em>, <em class="sig-param">a</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose3d.html#SO3.OA"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose3d.SO3.OA" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct a new SO(3) from two vectors</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>o</strong> (<em>array_like</em>) – 3-vector parallel to Y- axis</p></li>
<li><p><strong>a</strong> – 3-vector parallel to the Z-axis</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>SO(3) rotation</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>SO3 instance</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">SO3.OA(O,</span> <span class="pre">A)</span></code> is an SO(3) rotation defined in terms of
vectors parallel to the Y- and Z-axes of its reference frame.  In robotics these axes are
respectively called the <em>orientation</em> and <em>approach</em> vectors defined such that
R = [N, O, A] and N = O x A.</p>
<p>Notes:</p>
<ul class="simple">
<li><p>Only the <code class="docutils literal notranslate"><span class="pre">A</span></code> vector is guaranteed to have the same direction in the resulting
rotation matrix</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">O</span></code> and <code class="docutils literal notranslate"><span class="pre">A</span></code> do not have to be unit-length, they are normalized</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">O</span></code> and <a href="#id3"><span class="problematic" id="id4">``</span></a>A` do not have to be orthogonal, so long as they are not parallel</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.oa2r" title="spatialmath.base.transforms3d.oa2r"><code class="xref py py-func docutils literal notranslate"><span class="pre">spatialmath.base.transforms3d.oa2r()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.AngVec">
<em class="property">classmethod </em><code class="sig-name descname">AngVec</code><span class="sig-paren">(</span><em class="sig-param">theta</em>, <em class="sig-param">v</em>, <em class="sig-param">*</em>, <em class="sig-param">unit='rad'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose3d.html#SO3.AngVec"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose3d.SO3.AngVec" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct a new SO(3) rotation matrix from rotation angle and axis</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>theta</strong> (<em>float</em>) – rotation</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p></li>
<li><p><strong>v</strong> (<em>array_like</em>) – rotation axis, 3-vector</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>SO(3) rotation</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>SO3 instance</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">SO3.AngVec(theta,</span> <span class="pre">V)</span></code> is an SO(3) rotation defined by
a rotation of <code class="docutils literal notranslate"><span class="pre">THETA</span></code> about the vector <code class="docutils literal notranslate"><span class="pre">V</span></code>.</p>
<p>If <span class="math notranslate nohighlight">\(\theta \eq 0\)</span> the result in an identity matrix, otherwise
<code class="docutils literal notranslate"><span class="pre">V</span></code> must have a finite length, ie. <span class="math notranslate nohighlight">\(|V| &gt; 0\)</span>.</p>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><code class="xref py py-func docutils literal notranslate"><span class="pre">angvec()</span></code>, <a class="reference internal" href="#spatialmath.base.transforms3d.angvec2r" title="spatialmath.base.transforms3d.angvec2r"><code class="xref py py-func docutils literal notranslate"><span class="pre">spatialmath.base.transforms3d.angvec2r()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.Exp">
<em class="property">classmethod </em><code class="sig-name descname">Exp</code><span class="sig-paren">(</span><em class="sig-param">S</em>, <em class="sig-param">check=True</em>, <em class="sig-param">so3=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose3d.html#SO3.Exp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose3d.SO3.Exp" title="Permalink to this definition">¶</a></dt>
<dd><p>Create an SO(3) rotation matrix from so(3)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>S</strong> (<em>numpy ndarray</em>) – Lie algebra so(3)</p></li>
<li><p><strong>check</strong> (<em>bool</em>) – check that passed matrix is valid so(3), default True</p></li>
<li><p><strong>so3</strong> (<em>bool</em>) – input is an so(3) matrix (default True)</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>SO(3) rotation</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>SO3 instance</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">SO3.Exp(S)</span></code> is an SO(3) rotation defined by its Lie algebra
which is a 3x3 so(3) matrix (skew symmetric)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SO3.Exp(t)</span></code> is an SO(3) rotation defined by a 3-element twist
vector (the unique elements of the so(3) skew-symmetric matrix)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SO3.Exp(T)</span></code> is a sequence of SO(3) rotations defined by an Nx3 matrix
of twist vectors, one per row.</p></li>
</ul>
<p>Note:
- if :math:`    heta eq 0` the result in an identity matrix
- an input 3x3 matrix is ambiguous, it could be the first or third case above.  In this</p>
<blockquote>
<div><p>case the parameter <cite>so3</cite> is the decider.</p>
</div></blockquote>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.trexp" title="spatialmath.base.transforms3d.trexp"><code class="xref py py-func docutils literal notranslate"><span class="pre">spatialmath.base.transforms3d.trexp()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transformsNd.skew" title="spatialmath.base.transformsNd.skew"><code class="xref py py-func docutils literal notranslate"><span class="pre">spatialmath.base.transformsNd.skew()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.A">
<em class="property">property </em><code class="sig-name descname">A</code><a class="headerlink" href="#spatialmath.pose3d.SO3.A" title="Permalink to this definition">¶</a></dt>
<dd><p>Interal array representation (superclass property)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>self</strong> (<a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2"><em>SO2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><em>SE2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3"><em>SO3</em></a><em>, </em><em>SE3 instance</em>) – the pose object</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The numeric array</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray</p>
</dd>
</dl>
<p>Each pose subclass SO(N) or SE(N) are stored internally as a numpy array. This property returns
the array, shape depends on the particular subclass.</p>
<p>Examples:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">A</span>
<span class="go">array([[1., 0., 0., 0.],</span>
<span class="go">       [0., 1., 0., 0.],</span>
<span class="go">       [0., 0., 1., 0.],</span>
<span class="go">       [0., 0., 0., 1.]])</span>
</pre></div>
</div>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><cite>shape</cite>, <cite>N</cite></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.Empty">
<em class="property">classmethod </em><code class="sig-name descname">Empty</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SO3.Empty" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct a new pose object with zero items (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>cls</strong> (<a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2"><em>SO2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><em>SE2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3"><em>SO3</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SE3" title="spatialmath.pose3d.SE3"><em>SE3</em></a>) – The pose subclass</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>a pose with zero values</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2">SO2</a>, <a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2">SE2</a>, <a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3">SO3</a>, SE3 instance</p>
</dd>
</dl>
<p>This constructs an empty pose container which can be appended to.  For example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SO2</span><span class="o">.</span><span class="n">Empty</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">SO2</span><span class="p">(</span><span class="mi">20</span><span class="p">,</span> <span class="s1">&#39;deg&#39;</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">1</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.N">
<em class="property">property </em><code class="sig-name descname">N</code><a class="headerlink" href="#spatialmath.pose3d.SO3.N" title="Permalink to this definition">¶</a></dt>
<dd><p>Dimension of the object’s group (superclass property)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>dimension</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>int</p>
</dd>
</dl>
<p>Dimension of the group is 2 for <code class="docutils literal notranslate"><span class="pre">SO2</span></code> or <code class="docutils literal notranslate"><span class="pre">SE2</span></code>, and 3 for <code class="docutils literal notranslate"><span class="pre">SO3</span></code> or <code class="docutils literal notranslate"><span class="pre">SE3</span></code>.
This corresponds to the dimension of the space, 2D or 3D, to which these
rotations or rigid-body motions apply.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">N</span>
<span class="go">3</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.__add__">
<code class="sig-name descname">__add__</code><span class="sig-paren">(</span><em class="sig-param">right</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SO3.__add__" title="Permalink to this definition">¶</a></dt>
<dd><p>Overloaded <code class="docutils literal notranslate"><span class="pre">+</span></code> operator (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>left</strong> – left addend</p></li>
<li><p><strong>right</strong> – right addend</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>sum</p>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><strong>ValueError</strong> – for incompatible arguments</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy ndarray, shape=(N,N)</p>
</dd>
</dl>
<p>Add elements of two poses.  This is not a group operation so the
result is a matrix not a pose class.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">+</span> <span class="pre">Y</span></code> is the element-wise sum of the matrix value of <code class="docutils literal notranslate"><span class="pre">X</span></code> and <code class="docutils literal notranslate"><span class="pre">Y</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">+</span> <span class="pre">s</span></code> is the element-wise sum of the matrix value of <code class="docutils literal notranslate"><span class="pre">X</span></code> and <code class="docutils literal notranslate"><span class="pre">s</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">s</span> <span class="pre">+</span> <span class="pre">X</span></code> is the element-wise sum of the matrix value of <code class="docutils literal notranslate"><span class="pre">s</span></code> and <code class="docutils literal notranslate"><span class="pre">X</span></code></p></li>
</ul>
<table class="docutils align-default">
<colgroup>
<col style="width: 22%" />
<col style="width: 22%" />
<col style="width: 17%" />
<col style="width: 38%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head" colspan="2"><p>Operands</p></th>
<th class="head" colspan="2"><p>Sum</p></th>
</tr>
<tr class="row-even"><th class="head"><p>left</p></th>
<th class="head"><p>right</p></th>
<th class="head"><p>type</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-odd"><td><p>Pose</p></td>
<td><p>Pose</p></td>
<td><p>NxN matrix</p></td>
<td><p>element-wise matrix sum</p></td>
</tr>
<tr class="row-even"><td><p>Pose</p></td>
<td><p>scalar</p></td>
<td><p>NxN matrix</p></td>
<td><p>element-wise sum</p></td>
</tr>
<tr class="row-odd"><td><p>scalar</p></td>
<td><p>Pose</p></td>
<td><p>NxN matrix</p></td>
<td><p>element-wise sum</p></td>
</tr>
</tbody>
</table>
<p>Notes:</p>
<ol class="arabic simple">
<li><p>Pose is <code class="docutils literal notranslate"><span class="pre">SO2</span></code>, <code class="docutils literal notranslate"><span class="pre">SE2</span></code>, <code class="docutils literal notranslate"><span class="pre">SO3</span></code> or <code class="docutils literal notranslate"><span class="pre">SE3</span></code> instance</p></li>
<li><p>N is 2 for <code class="docutils literal notranslate"><span class="pre">SO2</span></code>, <code class="docutils literal notranslate"><span class="pre">SE2</span></code>; 3 for <code class="docutils literal notranslate"><span class="pre">SO3</span></code> or <code class="docutils literal notranslate"><span class="pre">SE3</span></code></p></li>
<li><p>scalar + Pose is handled by <code class="docutils literal notranslate"><span class="pre">__radd__</span></code></p></li>
<li><p>scalar addition is commutative</p></li>
<li><p>Any other input combinations result in a ValueError.</p></li>
</ol>
<p>For pose addition the <code class="docutils literal notranslate"><span class="pre">left</span></code> and <code class="docutils literal notranslate"><span class="pre">right</span></code> operands may be a sequence which
results in the result being a sequence:</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 16%" />
<col style="width: 18%" />
<col style="width: 7%" />
<col style="width: 58%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>len(left)</p></th>
<th class="head"><p>len(right)</p></th>
<th class="head"><p>len</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">+</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">+</span> <span class="pre">right[i]</span></code></p></td>
</tr>
<tr class="row-even"><td><p>N</p></td>
<td><p>1</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">+</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>M</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">+</span> <span class="pre">right[i]</span></code></p></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.__eq__">
<code class="sig-name descname">__eq__</code><span class="sig-paren">(</span><em class="sig-param">right</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SO3.__eq__" title="Permalink to this definition">¶</a></dt>
<dd><p>Overloaded <code class="docutils literal notranslate"><span class="pre">==</span></code> operator (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>left</strong> – left side of comparison</p></li>
<li><p><strong>right</strong> – right side of comparison</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>poses are equal</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
<p>Test two poses for equality</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">==</span> <span class="pre">Y</span></code> is true of the poses are of the same type and numerically
equal.</p></li>
</ul>
<p>If either operand contains a sequence the results is a sequence 
according to:</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 16%" />
<col style="width: 18%" />
<col style="width: 7%" />
<col style="width: 58%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>len(left)</p></th>
<th class="head"><p>len(right)</p></th>
<th class="head"><p>len</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">ret</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">==</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">ret[i]</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">==</span> <span class="pre">right[i]</span></code></p></td>
</tr>
<tr class="row-even"><td><p>N</p></td>
<td><p>1</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">ret[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">==</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>M</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">ret[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">==</span> <span class="pre">right[i]</span></code></p></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.__mul__">
<code class="sig-name descname">__mul__</code><span class="sig-paren">(</span><em class="sig-param">right</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SO3.__mul__" title="Permalink to this definition">¶</a></dt>
<dd><p>Overloaded <code class="docutils literal notranslate"><span class="pre">*</span></code> operator (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>left</strong> – left multiplicand</p></li>
<li><p><strong>right</strong> – right multiplicand</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>product</p>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p>ValueError</p>
</dd>
</dl>
<p>Pose composition, scaling or vector transformation:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">*</span> <span class="pre">Y</span></code> compounds the poses <code class="docutils literal notranslate"><span class="pre">X</span></code> and <code class="docutils literal notranslate"><span class="pre">Y</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">*</span> <span class="pre">s</span></code> performs elementwise multiplication of the elements of <code class="docutils literal notranslate"><span class="pre">X</span></code> by <code class="docutils literal notranslate"><span class="pre">s</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">s</span> <span class="pre">*</span> <span class="pre">X</span></code> performs elementwise multiplication of the elements of <code class="docutils literal notranslate"><span class="pre">X</span></code> by <code class="docutils literal notranslate"><span class="pre">s</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">*</span> <span class="pre">v</span></code> linear transform of the vector <code class="docutils literal notranslate"><span class="pre">v</span></code></p></li>
</ul>
<table class="docutils align-default">
<colgroup>
<col style="width: 23%" />
<col style="width: 23%" />
<col style="width: 18%" />
<col style="width: 36%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head" colspan="2"><p>Multiplicands</p></th>
<th class="head" colspan="2"><p>Product</p></th>
</tr>
<tr class="row-even"><th class="head"><p>left</p></th>
<th class="head"><p>right</p></th>
<th class="head"><p>type</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-odd"><td><p>Pose</p></td>
<td><p>Pose</p></td>
<td><p>Pose</p></td>
<td><p>matrix product</p></td>
</tr>
<tr class="row-even"><td><p>Pose</p></td>
<td><p>scalar</p></td>
<td><p>NxN matrix</p></td>
<td><p>element-wise product</p></td>
</tr>
<tr class="row-odd"><td><p>scalar</p></td>
<td><p>Pose</p></td>
<td><p>NxN matrix</p></td>
<td><p>element-wise product</p></td>
</tr>
<tr class="row-even"><td><p>Pose</p></td>
<td><p>N-vector</p></td>
<td><p>N-vector</p></td>
<td><p>vector transform</p></td>
</tr>
<tr class="row-odd"><td><p>Pose</p></td>
<td><p>NxM matrix</p></td>
<td><p>NxM matrix</p></td>
<td><p>transform each column</p></td>
</tr>
</tbody>
</table>
<p>Notes:</p>
<ol class="arabic simple">
<li><p>Pose is <code class="docutils literal notranslate"><span class="pre">SO2</span></code>, <code class="docutils literal notranslate"><span class="pre">SE2</span></code>, <code class="docutils literal notranslate"><span class="pre">SO3</span></code> or <code class="docutils literal notranslate"><span class="pre">SE3</span></code> instance</p></li>
<li><p>N is 2 for <code class="docutils literal notranslate"><span class="pre">SO2</span></code>, <code class="docutils literal notranslate"><span class="pre">SE2</span></code>; 3 for <code class="docutils literal notranslate"><span class="pre">SO3</span></code> or <code class="docutils literal notranslate"><span class="pre">SE3</span></code></p></li>
<li><p>scalar x Pose is handled by <code class="docutils literal notranslate"><span class="pre">__rmul__</span></code></p></li>
<li><p>scalar multiplication is commutative but the result is not a group
operation so the result will be a matrix</p></li>
<li><p>Any other input combinations result in a ValueError.</p></li>
</ol>
<p>For pose composition the <code class="docutils literal notranslate"><span class="pre">left</span></code> and <code class="docutils literal notranslate"><span class="pre">right</span></code> operands may be a sequence</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 16%" />
<col style="width: 18%" />
<col style="width: 7%" />
<col style="width: 58%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>len(left)</p></th>
<th class="head"><p>len(right)</p></th>
<th class="head"><p>len</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">*</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">*</span> <span class="pre">right[i]</span></code></p></td>
</tr>
<tr class="row-even"><td><p>N</p></td>
<td><p>1</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">*</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>M</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">*</span> <span class="pre">right[i]</span></code></p></td>
</tr>
</tbody>
</table>
<p>For vector transformation there are three cases</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 18%" />
<col style="width: 22%" />
<col style="width: 10%" />
<col style="width: 51%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head" colspan="2"><p>Multiplicands</p></th>
<th class="head" colspan="2"><p>Product</p></th>
</tr>
<tr class="row-even"><th class="head"><p>len(left)</p></th>
<th class="head"><p>right.shape</p></th>
<th class="head"><p>shape</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-odd"><td><p>1</p></td>
<td><p>(N,)</p></td>
<td><p>(N,)</p></td>
<td><p>vector transformation</p></td>
</tr>
<tr class="row-even"><td><p>M</p></td>
<td><p>(N,)</p></td>
<td><p>(N,M)</p></td>
<td><p>vector transformations</p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>(N,M)</p></td>
<td><p>(N,M)</p></td>
<td><p>column transformation</p></td>
</tr>
</tbody>
</table>
<p>Notes:</p>
<ol class="arabic simple">
<li><p>for the <code class="docutils literal notranslate"><span class="pre">SE2</span></code> and <code class="docutils literal notranslate"><span class="pre">SE3</span></code> case the vectors are converted to homogeneous
form, transformed, then converted back to Euclidean form.</p></li>
</ol>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.__ne__">
<code class="sig-name descname">__ne__</code><span class="sig-paren">(</span><em class="sig-param">right</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SO3.__ne__" title="Permalink to this definition">¶</a></dt>
<dd><p>Overloaded <code class="docutils literal notranslate"><span class="pre">!=</span></code> operator</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>left</strong> – left side of comparison</p></li>
<li><p><strong>right</strong> – right side of comparison</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>poses are not equal</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
<p>Test two poses for inequality</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">==</span> <span class="pre">Y</span></code> is true of the poses are of the same type but not numerically
equal.</p></li>
</ul>
<p>If either operand contains a sequence the results is a sequence 
according to:</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 16%" />
<col style="width: 18%" />
<col style="width: 7%" />
<col style="width: 58%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>len(left)</p></th>
<th class="head"><p>len(right)</p></th>
<th class="head"><p>len</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">ret</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">!=</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">ret[i]</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">!=</span> <span class="pre">right[i]</span></code></p></td>
</tr>
<tr class="row-even"><td><p>N</p></td>
<td><p>1</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">ret[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">!=</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>M</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">ret[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">!=</span> <span class="pre">right[i]</span></code></p></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.__pow__">
<code class="sig-name descname">__pow__</code><span class="sig-paren">(</span><em class="sig-param">n</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SO3.__pow__" title="Permalink to this definition">¶</a></dt>
<dd><p>Overloaded <code class="docutils literal notranslate"><span class="pre">**</span></code> operator (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>n</strong> – pose</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>pose to the power n</p>
</dd>
</dl>
<p>Raise all elements of pose to the specified power.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X**n</span></code> raise all values in <code class="docutils literal notranslate"><span class="pre">X</span></code> to the power <code class="docutils literal notranslate"><span class="pre">n</span></code></p></li>
</ul>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.__sub__">
<code class="sig-name descname">__sub__</code><span class="sig-paren">(</span><em class="sig-param">right</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SO3.__sub__" title="Permalink to this definition">¶</a></dt>
<dd><p>Overloaded <code class="docutils literal notranslate"><span class="pre">-</span></code> operator (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>left</strong> – left minuend</p></li>
<li><p><strong>right</strong> – right subtrahend</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>difference</p>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><strong>ValueError</strong> – for incompatible arguments</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy ndarray, shape=(N,N)</p>
</dd>
</dl>
<p>Subtract elements of two poses.  This is not a group operation so the
result is a matrix not a pose class.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">-</span> <span class="pre">Y</span></code> is the element-wise difference of the matrix value of <code class="docutils literal notranslate"><span class="pre">X</span></code> and <code class="docutils literal notranslate"><span class="pre">Y</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">-</span> <span class="pre">s</span></code> is the element-wise difference of the matrix value of <code class="docutils literal notranslate"><span class="pre">X</span></code> and <code class="docutils literal notranslate"><span class="pre">s</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">s</span> <span class="pre">-</span> <span class="pre">X</span></code> is the element-wise difference of <code class="docutils literal notranslate"><span class="pre">s</span></code> and the matrix value of <code class="docutils literal notranslate"><span class="pre">X</span></code></p></li>
</ul>
<table class="docutils align-default">
<colgroup>
<col style="width: 20%" />
<col style="width: 20%" />
<col style="width: 16%" />
<col style="width: 43%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head" colspan="2"><p>Operands</p></th>
<th class="head" colspan="2"><p>Sum</p></th>
</tr>
<tr class="row-even"><th class="head"><p>left</p></th>
<th class="head"><p>right</p></th>
<th class="head"><p>type</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-odd"><td><p>Pose</p></td>
<td><p>Pose</p></td>
<td><p>NxN matrix</p></td>
<td><p>element-wise matrix difference</p></td>
</tr>
<tr class="row-even"><td><p>Pose</p></td>
<td><p>scalar</p></td>
<td><p>NxN matrix</p></td>
<td><p>element-wise sum</p></td>
</tr>
<tr class="row-odd"><td><p>scalar</p></td>
<td><p>Pose</p></td>
<td><p>NxN matrix</p></td>
<td><p>element-wise sum</p></td>
</tr>
</tbody>
</table>
<p>Notes:</p>
<ol class="arabic simple">
<li><p>Pose is <code class="docutils literal notranslate"><span class="pre">SO2</span></code>, <code class="docutils literal notranslate"><span class="pre">SE2</span></code>, <code class="docutils literal notranslate"><span class="pre">SO3</span></code> or <code class="docutils literal notranslate"><span class="pre">SE3</span></code> instance</p></li>
<li><p>N is 2 for <code class="docutils literal notranslate"><span class="pre">SO2</span></code>, <code class="docutils literal notranslate"><span class="pre">SE2</span></code>; 3 for <code class="docutils literal notranslate"><span class="pre">SO3</span></code> or <code class="docutils literal notranslate"><span class="pre">SE3</span></code></p></li>
<li><p>scalar - Pose is handled by <code class="docutils literal notranslate"><span class="pre">__rsub__</span></code></p></li>
<li><p>Any other input combinations result in a ValueError.</p></li>
</ol>
<p>For pose addition the <code class="docutils literal notranslate"><span class="pre">left</span></code> and <code class="docutils literal notranslate"><span class="pre">right</span></code> operands may be a sequence which
results in the result being a sequence:</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 16%" />
<col style="width: 18%" />
<col style="width: 7%" />
<col style="width: 58%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>len(left)</p></th>
<th class="head"><p>len(right)</p></th>
<th class="head"><p>len</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">-</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">-</span> <span class="pre">right[i]</span></code></p></td>
</tr>
<tr class="row-even"><td><p>N</p></td>
<td><p>1</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">-</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>M</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span>&#160; <span class="pre">right[i]</span></code></p></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.__truediv__">
<code class="sig-name descname">__truediv__</code><span class="sig-paren">(</span><em class="sig-param">right</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SO3.__truediv__" title="Permalink to this definition">¶</a></dt>
<dd><p>Overloaded <code class="docutils literal notranslate"><span class="pre">/</span></code> operator (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>left</strong> – left multiplicand</p></li>
<li><p><strong>right</strong> – right multiplicand</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>product</p>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><strong>ValueError</strong> – for incompatible arguments</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy ndarray</p>
</dd>
</dl>
<p>Pose composition or scaling:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">/</span> <span class="pre">Y</span></code> compounds the poses <code class="docutils literal notranslate"><span class="pre">X</span></code> and <code class="docutils literal notranslate"><span class="pre">Y.inv()</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">/</span> <span class="pre">s</span></code> performs elementwise multiplication of the elements of <code class="docutils literal notranslate"><span class="pre">X</span></code> by <code class="docutils literal notranslate"><span class="pre">s</span></code></p></li>
</ul>
<table class="docutils align-default">
<colgroup>
<col style="width: 22%" />
<col style="width: 22%" />
<col style="width: 17%" />
<col style="width: 39%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head" colspan="2"><p>Multiplicands</p></th>
<th class="head" colspan="2"><p>Quotient</p></th>
</tr>
<tr class="row-even"><th class="head"><p>left</p></th>
<th class="head"><p>right</p></th>
<th class="head"><p>type</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-odd"><td><p>Pose</p></td>
<td><p>Pose</p></td>
<td><p>Pose</p></td>
<td><p>matrix product by inverse</p></td>
</tr>
<tr class="row-even"><td><p>Pose</p></td>
<td><p>scalar</p></td>
<td><p>NxN matrix</p></td>
<td><p>element-wise division</p></td>
</tr>
</tbody>
</table>
<p>Notes:</p>
<ol class="arabic simple">
<li><p>Pose is <code class="docutils literal notranslate"><span class="pre">SO2</span></code>, <code class="docutils literal notranslate"><span class="pre">SE2</span></code>, <code class="docutils literal notranslate"><span class="pre">SO3</span></code> or <code class="docutils literal notranslate"><span class="pre">SE3</span></code> instance</p></li>
<li><p>N is 2 for <code class="docutils literal notranslate"><span class="pre">SO2</span></code>, <code class="docutils literal notranslate"><span class="pre">SE2</span></code>; 3 for <code class="docutils literal notranslate"><span class="pre">SO3</span></code> or <code class="docutils literal notranslate"><span class="pre">SE3</span></code></p></li>
<li><p>scalar multiplication is not a group operation so the result will 
be a matrix</p></li>
<li><p>Any other input combinations result in a ValueError.</p></li>
</ol>
<p>For pose composition the <code class="docutils literal notranslate"><span class="pre">left</span></code> and <code class="docutils literal notranslate"><span class="pre">right</span></code> operands may be a sequence</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 15%" />
<col style="width: 16%" />
<col style="width: 7%" />
<col style="width: 62%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>len(left)</p></th>
<th class="head"><p>len(right)</p></th>
<th class="head"><p>len</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">*</span> <span class="pre">right.inv()</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">*</span> <span class="pre">right[i].inv()</span></code></p></td>
</tr>
<tr class="row-even"><td><p>N</p></td>
<td><p>1</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">*</span> <span class="pre">right.inv()</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>M</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">*</span> <span class="pre">right[i].inv()</span></code></p></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.about">
<em class="property">property </em><code class="sig-name descname">about</code><a class="headerlink" href="#spatialmath.pose3d.SO3.about" title="Permalink to this definition">¶</a></dt>
<dd><p>Succinct summary of object type and length (superclass property)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>succinct summary</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>str</p>
</dd>
</dl>
<p>Displays the type and the number of elements in compact form, for 
example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">([</span><span class="n">SE3</span><span class="p">()</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">20</span><span class="p">)])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">20</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">x</span><span class="o">.</span><span class="n">about</span><span class="p">)</span>
<span class="go">SE3[20]</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.animate">
<code class="sig-name descname">animate</code><span class="sig-paren">(</span><em class="sig-param">*args</em>, <em class="sig-param">T0=None</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SO3.animate" title="Permalink to this definition">¶</a></dt>
<dd><p>Plot pose object as an animated coordinate frame (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>**kwargs</strong> – plotting options</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X.plot()</span></code> displays the pose <code class="docutils literal notranslate"><span class="pre">X</span></code> as a coordinate frame moving
from the origin, or <code class="docutils literal notranslate"><span class="pre">T0</span></code>, in either 2D or 3D axes.  There are 
many options, see the links below.</p></li>
</ul>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">X</span> <span class="o">=</span> <span class="n">SE3</span><span class="o">.</span><span class="n">Rx</span><span class="p">(</span><span class="mf">0.3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">X</span><span class="o">.</span><span class="n">animate</span><span class="p">(</span><span class="n">frame</span><span class="o">=</span><span class="s1">&#39;A&#39;</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s1">&#39;green&#39;</span><span class="p">)</span>
</pre></div>
</div>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.tranimate" title="spatialmath.base.transforms3d.tranimate"><code class="xref py py-func docutils literal notranslate"><span class="pre">tranimate()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms2d.tranimate2" title="spatialmath.base.transforms2d.tranimate2"><code class="xref py py-func docutils literal notranslate"><span class="pre">tranimate2()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.append">
<code class="sig-name descname">append</code><span class="sig-paren">(</span><em class="sig-param">x</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SO3.append" title="Permalink to this definition">¶</a></dt>
<dd><p>Append a value to a pose object (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>x</strong> (<a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2"><em>SO2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><em>SE2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3"><em>SO3</em></a><em>, </em><em>SE3 instance</em>) – the value to append</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>ValueError</strong> – incorrect type of appended object</p>
</dd>
</dl>
<p>Appends the argument to the object’s internal list of values.</p>
<p>Examples:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">SE3</span><span class="o">.</span><span class="n">Rx</span><span class="p">(</span><span class="mf">0.1</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">2</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.clear">
<code class="sig-name descname">clear</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None -- remove all items from S<a class="headerlink" href="#spatialmath.pose3d.SO3.clear" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.extend">
<code class="sig-name descname">extend</code><span class="sig-paren">(</span><em class="sig-param">x</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SO3.extend" title="Permalink to this definition">¶</a></dt>
<dd><p>Extend sequence of values of a pose object (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>x</strong> (<a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2"><em>SO2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><em>SE2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3"><em>SO3</em></a><em>, </em><em>SE3 instance</em>) – the value to extend</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>ValueError</strong> – incorrect type of appended object</p>
</dd>
</dl>
<p>Appends the argument to the object’s internal list of values.</p>
<p>Examples:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">SE3</span><span class="o">.</span><span class="n">Rx</span><span class="p">(</span><span class="mf">0.1</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">2</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.insert">
<code class="sig-name descname">insert</code><span class="sig-paren">(</span><em class="sig-param">i</em>, <em class="sig-param">value</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SO3.insert" title="Permalink to this definition">¶</a></dt>
<dd><p>Insert a value to a pose object (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>i</strong> (<em>int</em>) – element to insert value before</p></li>
<li><p><strong>value</strong> (<a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2"><em>SO2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><em>SE2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3"><em>SO3</em></a><em>, </em><em>SE3 instance</em>) – the value to insert</p></li>
</ul>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>ValueError</strong> – incorrect type of inserted value</p>
</dd>
</dl>
<p>Inserts the argument into the object’s internal list of values.</p>
<p>Examples:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">inert</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">SE3</span><span class="o">.</span><span class="n">Rx</span><span class="p">(</span><span class="mf">0.1</span><span class="p">))</span> <span class="c1"># insert at position 0 in the list</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">2</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.interp">
<code class="sig-name descname">interp</code><span class="sig-paren">(</span><em class="sig-param">s=None</em>, <em class="sig-param">T0=None</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SO3.interp" title="Permalink to this definition">¶</a></dt>
<dd><p>Interpolate pose (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>T0</strong> (<a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2"><em>SO2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><em>SE2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3"><em>SO3</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SE3" title="spatialmath.pose3d.SE3"><em>SE3</em></a>) – initial pose</p></li>
<li><p><strong>s</strong> (<em>float</em><em> or </em><em>array_like</em>) – interpolation coefficient, range 0 to 1</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>interpolated pose</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2">SO2</a>, <a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2">SE2</a>, <a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3">SO3</a>, SE3 instance</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X.interp(s)</span></code> interpolates the pose X between identity when s=0
and X when s=1.</p></li>
</ul>
<blockquote>
<div><table class="docutils align-default">
<colgroup>
<col style="width: 11%" />
<col style="width: 11%" />
<col style="width: 20%" />
<col style="width: 57%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>len(X)</p></th>
<th class="head"><p>len(s)</p></th>
<th class="head"><p>len(result)</p></th>
<th class="head"><p>Result</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p>Y = interp(identity, X, s)</p></td>
</tr>
<tr class="row-odd"><td><p>M</p></td>
<td><p>1</p></td>
<td><p>M</p></td>
<td><p>Y[i] = interp(T0, X[i], s)</p></td>
</tr>
<tr class="row-even"><td><p>1</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p>Y[i] = interp(T0, X, s[i])</p></td>
</tr>
</tbody>
</table>
</div></blockquote>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="o">.</span><span class="n">Rx</span><span class="p">(</span><span class="mf">0.3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">x</span><span class="o">.</span><span class="n">interp</span><span class="p">(</span><span class="mi">0</span><span class="p">))</span>
<span class="go">SE3(array([[1., 0., 0., 0.],</span>
<span class="go">           [0., 1., 0., 0.],</span>
<span class="go">           [0., 0., 1., 0.],</span>
<span class="go">           [0., 0., 0., 1.]]))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">x</span><span class="o">.</span><span class="n">interp</span><span class="p">(</span><span class="mi">1</span><span class="p">))</span>
<span class="go">SE3(array([[ 1.        ,  0.        ,  0.        ,  0.        ],</span>
<span class="go">           [ 0.        ,  0.95533649, -0.29552021,  0.        ],</span>
<span class="go">           [ 0.        ,  0.29552021,  0.95533649,  0.        ],</span>
<span class="go">           [ 0.        ,  0.        ,  0.        ,  1.        ]]))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span> <span class="o">=</span> <span class="n">x</span><span class="o">.</span><span class="n">interp</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">linspace</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">10</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">y</span><span class="p">)</span>
<span class="go">10</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span><span class="p">[</span><span class="mi">5</span><span class="p">]</span>
<span class="go">SE3(array([[ 1.        ,  0.        ,  0.        ,  0.        ],</span>
<span class="go">           [ 0.        ,  0.98614323, -0.16589613,  0.        ],</span>
<span class="go">           [ 0.        ,  0.16589613,  0.98614323,  0.        ],</span>
<span class="go">           [ 0.        ,  0.        ,  0.        ,  1.        ]]))</span>
</pre></div>
</div>
<p>Notes:</p>
<ol class="arabic simple">
<li><p>For SO3 and SE3 rotation is interpolated using quaternion spherical linear interpolation (slerp).</p></li>
</ol>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.trinterp" title="spatialmath.base.transforms3d.trinterp"><code class="xref py py-func docutils literal notranslate"><span class="pre">trinterp()</span></code></a>, <a class="reference internal" href="#spatialmath.base.quaternions.slerp" title="spatialmath.base.quaternions.slerp"><code class="xref py py-func docutils literal notranslate"><span class="pre">spatialmath.base.quaternions.slerp()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms2d.trinterp2" title="spatialmath.base.transforms2d.trinterp2"><code class="xref py py-func docutils literal notranslate"><span class="pre">trinterp2()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.isSE">
<em class="property">property </em><code class="sig-name descname">isSE</code><a class="headerlink" href="#spatialmath.pose3d.SO3.isSE" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if object belongs to SE(n) group (superclass property)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>self</strong> (<a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2"><em>SO2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><em>SE2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3"><em>SO3</em></a><em>, </em><em>SE3 instance</em>) – object to test</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">True</span></code> if object is instance of SE2 or SE3</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.isSO">
<em class="property">property </em><code class="sig-name descname">isSO</code><a class="headerlink" href="#spatialmath.pose3d.SO3.isSO" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if object belongs to SO(n) group (superclass property)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>self</strong> (<a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2"><em>SO2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><em>SE2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3"><em>SO3</em></a><em>, </em><em>SE3 instance</em>) – object to test</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">True</span></code> if object is instance of SO2 or SO3</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.ishom">
<code class="sig-name descname">ishom</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SO3.ishom" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if object belongs to SE(3) group (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">True</span></code> if object is instance of SE3</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>bool</p>
</dd>
</dl>
<p>For compatibility with Spatial Math Toolbox for MATLAB.
In Python use <code class="docutils literal notranslate"><span class="pre">isinstance(x,</span> <span class="pre">SE3)</span></code>.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SO3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">isrot</span><span class="p">()</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">isrot</span><span class="p">()</span>
<span class="go">True</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.ishom2">
<code class="sig-name descname">ishom2</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SO3.ishom2" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if object belongs to SE(2) group (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">True</span></code> if object is instance of SE2</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>bool</p>
</dd>
</dl>
<p>For compatibility with Spatial Math Toolbox for MATLAB.
In Python use <code class="docutils literal notranslate"><span class="pre">isinstance(x,</span> <span class="pre">SE2)</span></code>.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SO2</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">isrot</span><span class="p">()</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE2</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">isrot</span><span class="p">()</span>
<span class="go">True</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.isrot">
<code class="sig-name descname">isrot</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SO3.isrot" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if object belongs to SO(3) group (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">True</span></code> if object is instance of SO3</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>bool</p>
</dd>
</dl>
<p>For compatibility with Spatial Math Toolbox for MATLAB.
In Python use <code class="docutils literal notranslate"><span class="pre">isinstance(x,</span> <span class="pre">SO3)</span></code>.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SO3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">isrot</span><span class="p">()</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">isrot</span><span class="p">()</span>
<span class="go">False</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.isrot2">
<code class="sig-name descname">isrot2</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SO3.isrot2" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if object belongs to SO(2) group (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">True</span></code> if object is instance of SO2</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>bool</p>
</dd>
</dl>
<p>For compatibility with Spatial Math Toolbox for MATLAB.
In Python use <code class="docutils literal notranslate"><span class="pre">isinstance(x,</span> <span class="pre">SO2)</span></code>.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SO2</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">isrot</span><span class="p">()</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE2</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">isrot</span><span class="p">()</span>
<span class="go">False</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.log">
<code class="sig-name descname">log</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SO3.log" title="Permalink to this definition">¶</a></dt>
<dd><p>Logarithm of pose (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>logarithm</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>numpy.ndarray</p>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p>ValueError</p>
</dd>
</dl>
<p>An efficient closed-form solution of the matrix logarithm.</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 12%" />
<col style="width: 14%" />
<col style="width: 74%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Input</p></th>
<th class="head" colspan="2"><p>Output</p></th>
</tr>
<tr class="row-even"><th class="head"><p>Pose</p></th>
<th class="head"><p>Shape</p></th>
<th class="head"><p>Structure</p></th>
</tr>
</thead>
<tbody>
<tr class="row-odd"><td><p>SO2</p></td>
<td><p>(2,2)</p></td>
<td><p>skew-symmetric</p></td>
</tr>
<tr class="row-even"><td><p>SE2</p></td>
<td><p>(3,3)</p></td>
<td><p>augmented skew-symmetric</p></td>
</tr>
<tr class="row-odd"><td><p>SO3</p></td>
<td><p>(3,3)</p></td>
<td><p>skew-symmetric</p></td>
</tr>
<tr class="row-even"><td><p>SE3</p></td>
<td><p>(4,4)</p></td>
<td><p>augmented skew-symmetric</p></td>
</tr>
</tbody>
</table>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="o">.</span><span class="n">Rx</span><span class="p">(</span><span class="mf">0.3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span> <span class="o">=</span> <span class="n">x</span><span class="o">.</span><span class="n">log</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span>
<span class="go">array([[ 0. , -0. ,  0. ,  0. ],</span>
<span class="go">       [ 0. ,  0. , -0.3,  0. ],</span>
<span class="go">       [-0. ,  0.3,  0. ,  0. ],</span>
<span class="go">       [ 0. ,  0. ,  0. ,  0. ]])</span>
</pre></div>
</div>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms2d.trlog2" title="spatialmath.base.transforms2d.trlog2"><code class="xref py py-func docutils literal notranslate"><span class="pre">trlog2()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms3d.trlog" title="spatialmath.base.transforms3d.trlog"><code class="xref py py-func docutils literal notranslate"><span class="pre">trlog()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.norm">
<code class="sig-name descname">norm</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SO3.norm" title="Permalink to this definition">¶</a></dt>
<dd><p>Normalize pose (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>pose</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2">SO2</a>, <a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2">SE2</a>, <a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3">SO3</a>, SE3 instance</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X.norm()</span></code> is an equivalent pose object but the rotational matrix 
part of all values has been adjusted to ensure it is a proper orthogonal
matrix rotation.</p></li>
</ul>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span> <span class="o">=</span> <span class="n">x</span><span class="o">.</span><span class="n">norm</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span>
<span class="go">SE3(array([[1., 0., 0., 0.],</span>
<span class="go">           [0., 1., 0., 0.],</span>
<span class="go">           [0., 0., 1., 0.],</span>
<span class="go">           [0., 0., 0., 1.]]))</span>
</pre></div>
</div>
<p>Notes:</p>
<ol class="arabic simple">
<li><p>Only the direction of A vector (the z-axis) is unchanged.</p></li>
<li><p>Used to prevent finite word length arithmetic causing transforms to 
become ‘unnormalized’.</p></li>
</ol>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.trnorm" title="spatialmath.base.transforms3d.trnorm"><code class="xref py py-func docutils literal notranslate"><span class="pre">trnorm()</span></code></a>, <code class="xref py py-func docutils literal notranslate"><span class="pre">trnorm2()</span></code></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.plot">
<code class="sig-name descname">plot</code><span class="sig-paren">(</span><em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SO3.plot" title="Permalink to this definition">¶</a></dt>
<dd><p>Plot pose object as a coordinate frame (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>**kwargs</strong> – plotting options</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X.plot()</span></code> displays the pose <code class="docutils literal notranslate"><span class="pre">X</span></code> as a coordinate frame in either
2D or 3D axes.  There are many options, see the links below.</p></li>
</ul>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">X</span> <span class="o">=</span> <span class="n">SE3</span><span class="o">.</span><span class="n">Rx</span><span class="p">(</span><span class="mf">0.3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">X</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">frame</span><span class="o">=</span><span class="s1">&#39;A&#39;</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s1">&#39;green&#39;</span><span class="p">)</span>
</pre></div>
</div>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.trplot" title="spatialmath.base.transforms3d.trplot"><code class="xref py py-func docutils literal notranslate"><span class="pre">trplot()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms2d.trplot2" title="spatialmath.base.transforms2d.trplot2"><code class="xref py py-func docutils literal notranslate"><span class="pre">trplot2()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.pop">
<code class="sig-name descname">pop</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SO3.pop" title="Permalink to this definition">¶</a></dt>
<dd><p>Pop value of a pose object (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>the specific element of the pose</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2">SO2</a>, <a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2">SE2</a>, <a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3">SO3</a>, SE3 instance</p>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><strong>IndexError</strong> – if there are no values to pop</p>
</dd>
</dl>
<p>Removes the first pose value from the sequence in the pose object.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="o">.</span><span class="n">Rx</span><span class="p">([</span><span class="mi">0</span><span class="p">,</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="o">/</span><span class="mi">2</span><span class="p">,</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">3</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span> <span class="o">=</span> <span class="n">x</span><span class="o">.</span><span class="n">pop</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span>
<span class="go">SE3(array([[ 1.0000000e+00,  0.0000000e+00,  0.0000000e+00,  0.0000000e+00],</span>
<span class="go">           [ 0.0000000e+00, -1.0000000e+00, -1.2246468e-16,  0.0000000e+00],</span>
<span class="go">           [ 0.0000000e+00,  1.2246468e-16, -1.0000000e+00,  0.0000000e+00],</span>
<span class="go">           [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00,  1.0000000e+00]]))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">2</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.printline">
<code class="sig-name descname">printline</code><span class="sig-paren">(</span><em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SO3.printline" title="Permalink to this definition">¶</a></dt>
<dd><p>Print pose as a single line (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>label</strong> (<em>str</em>) – text label to put at start of line</p></li>
<li><p><strong>file</strong> (<em>str</em>) – file to write formatted string to. [default, stdout]</p></li>
<li><p><strong>fmt</strong> (<em>str</em>) – conversion format for each number as used by <code class="docutils literal notranslate"><span class="pre">format()</span></code></p></li>
<li><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>optional formatted string</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
<p>For SO(3) or SE(3) also:</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>orient</strong> (<em>str</em>) – 3-angle convention to use</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X.printline()</span></code> print <code class="docutils literal notranslate"><span class="pre">X</span></code> in single-line format to <code class="docutils literal notranslate"><span class="pre">stdout</span></code>, followed
by a newline</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">X.printline(file=None)</span></code> return a string containing <code class="docutils literal notranslate"><span class="pre">X</span></code> in 
single-line format</p></li>
</ul>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">=</span><span class="n">SE3</span><span class="o">.</span><span class="n">Rx</span><span class="p">(</span><span class="mf">0.3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">printline</span><span class="p">()</span>
<span class="go">t =        0,        0,        0; rpy/zyx =       17,        0,        0 deg</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.reverse">
<code class="sig-name descname">reverse</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SO3.reverse" title="Permalink to this definition">¶</a></dt>
<dd><p>S.reverse() – reverse <em>IN PLACE</em></p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SO3.shape">
<em class="property">property </em><code class="sig-name descname">shape</code><a class="headerlink" href="#spatialmath.pose3d.SO3.shape" title="Permalink to this definition">¶</a></dt>
<dd><p>Shape of the object’s matrix representation (superclass property)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>matrix shape</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>2-tuple of ints</p>
</dd>
</dl>
<p>(2,2) for <code class="docutils literal notranslate"><span class="pre">SO2</span></code>, (3,3) for <code class="docutils literal notranslate"><span class="pre">SE2</span></code> and <code class="docutils literal notranslate"><span class="pre">SO3</span></code>, and (4,4) for <code class="docutils literal notranslate"><span class="pre">SE3</span></code>.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">shape</span>
<span class="go">(4, 4)</span>
</pre></div>
</div>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="spatialmath.pose3d.SE3">
<em class="property">class </em><code class="sig-prename descclassname">spatialmath.pose3d.</code><code class="sig-name descname">SE3</code><span class="sig-paren">(</span><em class="sig-param">x=None</em>, <em class="sig-param">y=None</em>, <em class="sig-param">z=None</em>, <em class="sig-param">*</em>, <em class="sig-param">check=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose3d.html#SE3"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose3d.SE3" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3"><code class="xref py py-class docutils literal notranslate"><span class="pre">spatialmath.pose3d.SO3</span></code></a></p>
<dl class="method">
<dt id="spatialmath.pose3d.SE3.__init__">
<code class="sig-name descname">__init__</code><span class="sig-paren">(</span><em class="sig-param">x=None</em>, <em class="sig-param">y=None</em>, <em class="sig-param">z=None</em>, <em class="sig-param">*</em>, <em class="sig-param">check=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose3d.html#SE3.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose3d.SE3.__init__" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct new SE(3) object</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<em>float</em>) – translation distance along the X-axis</p></li>
<li><p><strong>y</strong> (<em>float</em>) – translation distance along the Y-axis</p></li>
<li><p><strong>z</strong> (<em>float</em>) – translation distance along the Z-axis</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>4x4 homogeneous transformation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>SE3 instance</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">SE3()</span></code> is a null motion – the identity matrix</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SE3(x,</span> <span class="pre">y,</span> <span class="pre">z)</span></code> is a pure translation of (x,y,z)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SE3(T)</span></code> where T is a 4x4 numpy array representing an SE(3) matrix.  If <code class="docutils literal notranslate"><span class="pre">check</span></code>
is <code class="docutils literal notranslate"><span class="pre">True</span></code> check the matrix belongs to SE(3).</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SE3([T1,</span> <span class="pre">T2,</span> <span class="pre">...</span> <span class="pre">TN])</span></code> where each Ti is a 4x4 numpy array representing an SE(3) matrix, is
an SE3 instance containing N rotations. If <code class="docutils literal notranslate"><span class="pre">check</span></code> is <code class="docutils literal notranslate"><span class="pre">True</span></code>
check the matrix belongs to SE(3).</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SE3([X1,</span> <span class="pre">X2,</span> <span class="pre">...</span> <span class="pre">XN])</span></code> where each Xi is an SE3 instance, is an SE3 instance containing N rotations.</p></li>
</ul>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.t">
<em class="property">property </em><code class="sig-name descname">t</code><a class="headerlink" href="#spatialmath.pose3d.SE3.t" title="Permalink to this definition">¶</a></dt>
<dd><p>Translational component of SE(3)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>self</strong> (<em>SE3 instance</em>) – SE(3)</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>translational component</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">T.t</span></code> returns an:</p>
<ul class="simple">
<li><p>ndarray with shape=(3,), if len(T) == 1</p></li>
<li><p>ndarray with shape=(N,3), if len(T) = N &gt; 1</p></li>
</ul>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.inv">
<code class="sig-name descname">inv</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose3d.html#SE3.inv"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose3d.SE3.inv" title="Permalink to this definition">¶</a></dt>
<dd><p>Inverse of SE(3)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>inverse</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference internal" href="#spatialmath.pose3d.SE3" title="spatialmath.pose3d.SE3">SE3</a></p>
</dd>
</dl>
<p>Returns the inverse taking into account its structure</p>
<p><span class="math notranslate nohighlight">\(T = \left[ \begin{array}{cc} R &amp; t \\ 0 &amp; 1 \end{array} \right], T^{-1} = \left[ \begin{array}{cc} R^T &amp; -R^T t \\ 0 &amp; 1 \end{array} \right]\)</span></p>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><code class="xref py py-func docutils literal notranslate"><span class="pre">trinv()</span></code></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.delta">
<code class="sig-name descname">delta</code><span class="sig-paren">(</span><em class="sig-param">X2</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose3d.html#SE3.delta"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose3d.SE3.delta" title="Permalink to this definition">¶</a></dt>
<dd><p>Difference of SE(3)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>X1</strong> (<a class="reference internal" href="#spatialmath.pose3d.SE3" title="spatialmath.pose3d.SE3"><em>SE3</em></a>) – </p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>differential motion vector</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(6,)</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X1.delta(T2)</span></code> is the differential motion (6x1) corresponding to 
infinitessimal motion (in the X1 frame) from pose X1 to X2.</p></li>
</ul>
<p>The vector <span class="math notranslate nohighlight">\(d = [\delta_x, \delta_y, \delta_z, \theta_x, \theta_y, \theta_z\)</span>
represents infinitessimal translation and rotation.</p>
<p>Notes:</p>
<ul class="simple">
<li><p>the displacement is only an approximation to the motion T, and assumes
that X1 ~ X2.</p></li>
<li><p>Can be considered as an approximation to the effect of spatial velocity over a
a time interval, average spatial velocity multiplied by time.</p></li>
</ul>
<p>Reference: Robotics, Vision &amp; Control: Second Edition, P. Corke, Springer 2016; p67.</p>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><code class="xref py py-func docutils literal notranslate"><span class="pre">tr2delta()</span></code></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.isvalid">
<em class="property">static </em><code class="sig-name descname">isvalid</code><span class="sig-paren">(</span><em class="sig-param">x</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose3d.html#SE3.isvalid"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose3d.SE3.isvalid" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if matrix is valid SE(3)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>x</strong> (<em>numpy.ndarray</em>) – matrix to test</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>true of the matrix is 4x4 and a valid element of SE(3), ie. it is an
homogeneous transformation matrix.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
<dt class="field-even">Seealso</dt>
<dd class="field-even"><p><code class="xref py py-func docutils literal notranslate"><span class="pre">ishom()</span></code></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.Rx">
<em class="property">classmethod </em><code class="sig-name descname">Rx</code><span class="sig-paren">(</span><em class="sig-param">theta</em>, <em class="sig-param">unit='rad'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose3d.html#SE3.Rx"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose3d.SE3.Rx" title="Permalink to this definition">¶</a></dt>
<dd><p>Create SE(3) pure rotation about the X-axis</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>theta</strong> (<em>float</em>) – rotation angle about X-axis</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>4x4 homogeneous transformation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>SE3 instance</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">SE3.Rx(THETA)</span></code> is an SO(3) rotation of THETA radians about the x-axis</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SE3.Rx(THETA,</span> <span class="pre">&quot;deg&quot;)</span></code> as above but THETA is in degrees</p></li>
</ul>
<p>If <code class="docutils literal notranslate"><span class="pre">theta</span></code> is an array then the result is a sequence of rotations defined by consecutive
elements.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.Ry">
<em class="property">classmethod </em><code class="sig-name descname">Ry</code><span class="sig-paren">(</span><em class="sig-param">theta</em>, <em class="sig-param">unit='rad'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose3d.html#SE3.Ry"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose3d.SE3.Ry" title="Permalink to this definition">¶</a></dt>
<dd><p>Create SE(3) pure rotation about the Y-axis</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>theta</strong> (<em>float</em>) – rotation angle about X-axis</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>4x4 homogeneous transformation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>SE3 instance</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">SE3.Ry(THETA)</span></code> is an SO(3) rotation of THETA radians about the y-axis</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SE3.Ry(THETA,</span> <span class="pre">&quot;deg&quot;)</span></code> as above but THETA is in degrees</p></li>
</ul>
<p>If <code class="docutils literal notranslate"><span class="pre">theta</span></code> is an array then the result is a sequence of rotations defined by consecutive
elements.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.Rz">
<em class="property">classmethod </em><code class="sig-name descname">Rz</code><span class="sig-paren">(</span><em class="sig-param">theta</em>, <em class="sig-param">unit='rad'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose3d.html#SE3.Rz"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose3d.SE3.Rz" title="Permalink to this definition">¶</a></dt>
<dd><p>Create SE(3) pure rotation about the Z-axis</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>theta</strong> (<em>float</em>) – rotation angle about Z-axis</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>4x4 homogeneous transformation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>SE3 instance</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">SE3.Rz(THETA)</span></code> is an SO(3) rotation of THETA radians about the z-axis</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SE3.Rz(THETA,</span> <span class="pre">&quot;deg&quot;)</span></code> as above but THETA is in degrees</p></li>
</ul>
<p>If <code class="docutils literal notranslate"><span class="pre">theta</span></code> is an array then the result is a sequence of rotations defined by consecutive
elements.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.Rand">
<em class="property">classmethod </em><code class="sig-name descname">Rand</code><span class="sig-paren">(</span><em class="sig-param">*, xrange=[-1, 1], yrange=[-1, 1], zrange=[-1, 1], N=1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose3d.html#SE3.Rand"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose3d.SE3.Rand" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a random SE(3)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>xrange</strong> (<em>2-element sequence</em><em>, </em><em>optional</em>) – x-axis range [min,max], defaults to [-1, 1]</p></li>
<li><p><strong>yrange</strong> (<em>2-element sequence</em><em>, </em><em>optional</em>) – y-axis range [min,max], defaults to [-1, 1]</p></li>
<li><p><strong>zrange</strong> (<em>2-element sequence</em><em>, </em><em>optional</em>) – z-axis range [min,max], defaults to [-1, 1]</p></li>
<li><p><strong>N</strong> (<em>int</em>) – number of random transforms</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>homogeneous transformation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>SE3 instance</p>
</dd>
</dl>
<p>Return an SE3 instance with random rotation and translation.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">SE3.Rand()</span></code> is a random SE(3) translation.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SE3.Rand(N)</span></code> is an SE3 object containing a sequence of N random
poses.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><cite>~spatialmath.quaternion.UnitQuaternion.Rand</cite></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.Eul">
<em class="property">classmethod </em><code class="sig-name descname">Eul</code><span class="sig-paren">(</span><em class="sig-param">angles</em>, <em class="sig-param">unit='rad'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose3d.html#SE3.Eul"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose3d.SE3.Eul" title="Permalink to this definition">¶</a></dt>
<dd><p>Create an SE(3) pure rotation from Euler angles</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>angles</strong> (<em>array_like</em><em> or </em><em>numpy.ndarray with shape=</em><em>(</em><em>N</em><em>,</em><em>3</em><em>)</em>) – 3-vector of Euler angles</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>4x4 homogeneous transformation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>SE3 instance</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">SE3.Eul(ANGLES)</span></code> is an SO(3) rotation defined by a 3-vector of Euler angles <span class="math notranslate nohighlight">\((\phi,    heta, \psi)\)</span> which
correspond to consecutive rotations about the Z, Y, Z axes respectively.</p>
<p>If <code class="docutils literal notranslate"><span class="pre">angles</span></code> is an Nx3 matrix then the result is a sequence of rotations each defined by Euler angles
correponding to the rows of angles.</p>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.pose3d.SE3.eul" title="spatialmath.pose3d.SE3.eul"><code class="xref py py-func docutils literal notranslate"><span class="pre">eul()</span></code></a>, <a class="reference internal" href="#spatialmath.pose3d.SE3.Eul" title="spatialmath.pose3d.SE3.Eul"><code class="xref py py-func docutils literal notranslate"><span class="pre">Eul()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms3d.eul2r" title="spatialmath.base.transforms3d.eul2r"><code class="xref py py-func docutils literal notranslate"><span class="pre">spatialmath.base.transforms3d.eul2r()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.RPY">
<em class="property">classmethod </em><code class="sig-name descname">RPY</code><span class="sig-paren">(</span><em class="sig-param">angles</em>, <em class="sig-param">order='zyx'</em>, <em class="sig-param">unit='rad'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose3d.html#SE3.RPY"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose3d.SE3.RPY" title="Permalink to this definition">¶</a></dt>
<dd><p>Create an SO(3) pure rotation from roll-pitch-yaw angles</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>angles</strong> (<em>array_like</em><em> or </em><em>numpy.ndarray with shape=</em><em>(</em><em>N</em><em>,</em><em>3</em><em>)</em>) – 3-vector of roll-pitch-yaw angles</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p></li>
<li><p><strong>unit</strong> – rotation order: ‘zyx’ [default], ‘xyz’, or ‘yxz’</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>4x4 homogeneous transformation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>SE3 instance</p>
</dd>
</dl>
<dl>
<dt><code class="docutils literal notranslate"><span class="pre">SE3.RPY(ANGLES)</span></code> is an SE(3) rotation defined by a 3-vector of roll, pitch, yaw angles <span class="math notranslate nohighlight">\((r, p, y)\)</span></dt><dd><p>which correspond to successive rotations about the axes specified by <code class="docutils literal notranslate"><span class="pre">order</span></code>:</p>
<blockquote>
<div><ul class="simple">
<li><p>‘zyx’ [default], rotate by yaw about the z-axis, then by pitch about the new y-axis,
then by roll about the new x-axis.  Convention for a mobile robot with x-axis forward
and y-axis sideways.</p></li>
<li><p>‘xyz’, rotate by yaw about the x-axis, then by pitch about the new y-axis,
then by roll about the new z-axis. Covention for a robot gripper with z-axis forward
and y-axis between the gripper fingers.</p></li>
<li><p>‘yxz’, rotate by yaw about the y-axis, then by pitch about the new x-axis,
then by roll about the new z-axis. Convention for a camera with z-axis parallel
to the optic axis and x-axis parallel to the pixel rows.</p></li>
</ul>
</div></blockquote>
</dd>
</dl>
<p>If <code class="docutils literal notranslate"><span class="pre">angles</span></code> is an Nx3 matrix then the result is a sequence of rotations each defined by RPY angles
correponding to the rows of angles.</p>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.pose3d.SE3.rpy" title="spatialmath.pose3d.SE3.rpy"><code class="xref py py-func docutils literal notranslate"><span class="pre">rpy()</span></code></a>, <a class="reference internal" href="#spatialmath.pose3d.SE3.RPY" title="spatialmath.pose3d.SE3.RPY"><code class="xref py py-func docutils literal notranslate"><span class="pre">RPY()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms3d.rpy2r" title="spatialmath.base.transforms3d.rpy2r"><code class="xref py py-func docutils literal notranslate"><span class="pre">spatialmath.base.transforms3d.rpy2r()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.OA">
<em class="property">classmethod </em><code class="sig-name descname">OA</code><span class="sig-paren">(</span><em class="sig-param">o</em>, <em class="sig-param">a</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose3d.html#SE3.OA"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose3d.SE3.OA" title="Permalink to this definition">¶</a></dt>
<dd><p>Create SE(3) pure rotation from two vectors</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>o</strong> (<em>array_like</em>) – 3-vector parallel to Y- axis</p></li>
<li><p><strong>a</strong> – 3-vector parallel to the Z-axis</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>4x4 homogeneous transformation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>SE3 instance</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">SE3.OA(O,</span> <span class="pre">A)</span></code> is an SE(3) rotation defined in terms of
vectors parallel to the Y- and Z-axes of its reference frame.  In robotics these axes are
respectively called the orientation and approach vectors defined such that
R = [N O A] and N = O x A.</p>
<p>Notes:</p>
<ul class="simple">
<li><p>The A vector is the only guaranteed to have the same direction in the resulting
rotation matrix</p></li>
<li><p>O and A do not have to be unit-length, they are normalized</p></li>
<li><p>O and A do not have to be orthogonal, so long as they are not parallel</p></li>
<li><p>The vectors O and A are parallel to the Y- and Z-axes of the equivalent coordinate frame.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.oa2r" title="spatialmath.base.transforms3d.oa2r"><code class="xref py py-func docutils literal notranslate"><span class="pre">spatialmath.base.transforms3d.oa2r()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.AngVec">
<em class="property">classmethod </em><code class="sig-name descname">AngVec</code><span class="sig-paren">(</span><em class="sig-param">theta</em>, <em class="sig-param">v</em>, <em class="sig-param">*</em>, <em class="sig-param">unit='rad'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose3d.html#SE3.AngVec"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose3d.SE3.AngVec" title="Permalink to this definition">¶</a></dt>
<dd><p>Create an SE(3) pure rotation matrix from rotation angle and axis</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>theta</strong> (<em>float</em>) – rotation</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p></li>
<li><p><strong>v</strong> (<em>array_like</em>) – rotation axis, 3-vector</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>4x4 homogeneous transformation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>SE3 instance</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">SE3.AngVec(THETA,</span> <span class="pre">V)</span></code> is an SE(3) rotation defined by
a rotation of <code class="docutils literal notranslate"><span class="pre">THETA</span></code> about the vector <code class="docutils literal notranslate"><span class="pre">V</span></code>.</p>
<p>Notes:</p>
<ul class="simple">
<li><p>If <code class="docutils literal notranslate"><span class="pre">THETA</span> <span class="pre">==</span> <span class="pre">0</span></code> then return identity matrix.</p></li>
<li><p>If <code class="docutils literal notranslate"><span class="pre">THETA</span> <span class="pre">~=</span> <span class="pre">0</span></code> then <code class="docutils literal notranslate"><span class="pre">V</span></code> must have a finite length.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><code class="xref py py-func docutils literal notranslate"><span class="pre">angvec()</span></code>, <a class="reference internal" href="#spatialmath.base.transforms3d.angvec2r" title="spatialmath.base.transforms3d.angvec2r"><code class="xref py py-func docutils literal notranslate"><span class="pre">spatialmath.base.transforms3d.angvec2r()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.Exp">
<em class="property">classmethod </em><code class="sig-name descname">Exp</code><span class="sig-paren">(</span><em class="sig-param">S</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose3d.html#SE3.Exp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose3d.SE3.Exp" title="Permalink to this definition">¶</a></dt>
<dd><p>Create an SE(3) rotation matrix from se(3)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>S</strong> (<em>numpy ndarray</em>) – Lie algebra se(3)</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>3x3 rotation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>SO3 instance</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">SE3.Exp(S)</span></code> is an SE(3) rotation defined by its Lie algebra
which is a 3x3 se(3) matrix (skew symmetric)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SE3.Exp(t)</span></code> is an SE(3) rotation defined by a 6-element twist
vector (the unique elements of the se(3) skew-symmetric matrix)</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.trexp" title="spatialmath.base.transforms3d.trexp"><code class="xref py py-func docutils literal notranslate"><span class="pre">spatialmath.base.transforms3d.trexp()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transformsNd.skew" title="spatialmath.base.transformsNd.skew"><code class="xref py py-func docutils literal notranslate"><span class="pre">spatialmath.base.transformsNd.skew()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.Tx">
<em class="property">classmethod </em><code class="sig-name descname">Tx</code><span class="sig-paren">(</span><em class="sig-param">x</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose3d.html#SE3.Tx"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose3d.SE3.Tx" title="Permalink to this definition">¶</a></dt>
<dd><p>Create SE(3) translation along the X-axis</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>theta</strong> (<em>float</em>) – translation distance along the X-axis</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>4x4 homogeneous transformation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>SE3 instance</p>
</dd>
</dl>
<p><cite>SE3.Tz(D)`</cite> is an SE(3) translation of D along the x-axis</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.Ty">
<em class="property">classmethod </em><code class="sig-name descname">Ty</code><span class="sig-paren">(</span><em class="sig-param">y</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose3d.html#SE3.Ty"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose3d.SE3.Ty" title="Permalink to this definition">¶</a></dt>
<dd><p>Create SE(3) translation along the Y-axis</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>theta</strong> (<em>float</em>) – translation distance along the Y-axis</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>4x4 homogeneous transformation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>SE3 instance</p>
</dd>
</dl>
<p><cite>SE3.Tz(D)`</cite> is an SE(3) translation of D along the y-axis</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.Tz">
<em class="property">classmethod </em><code class="sig-name descname">Tz</code><span class="sig-paren">(</span><em class="sig-param">z</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose3d.html#SE3.Tz"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose3d.SE3.Tz" title="Permalink to this definition">¶</a></dt>
<dd><p>Create SE(3) translation along the Z-axis</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>theta</strong> (<em>float</em>) – translation distance along the Z-axis</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>4x4 homogeneous transformation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>SE3 instance</p>
</dd>
</dl>
<p><cite>SE3.Tz(D)`</cite> is an SE(3) translation of D along the z-axis</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.A">
<em class="property">property </em><code class="sig-name descname">A</code><a class="headerlink" href="#spatialmath.pose3d.SE3.A" title="Permalink to this definition">¶</a></dt>
<dd><p>Interal array representation (superclass property)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>self</strong> (<a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2"><em>SO2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><em>SE2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3"><em>SO3</em></a><em>, </em><em>SE3 instance</em>) – the pose object</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The numeric array</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray</p>
</dd>
</dl>
<p>Each pose subclass SO(N) or SE(N) are stored internally as a numpy array. This property returns
the array, shape depends on the particular subclass.</p>
<p>Examples:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">A</span>
<span class="go">array([[1., 0., 0., 0.],</span>
<span class="go">       [0., 1., 0., 0.],</span>
<span class="go">       [0., 0., 1., 0.],</span>
<span class="go">       [0., 0., 0., 1.]])</span>
</pre></div>
</div>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><cite>shape</cite>, <cite>N</cite></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.Ad">
<code class="sig-name descname">Ad</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SE3.Ad" title="Permalink to this definition">¶</a></dt>
<dd><p>Adjoint of SO(3)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>adjoint matrix</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>numpy.ndarray, shape=(6,6)</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">SE3.Ad</span></code> is the 6x6 adjoint matrix</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>Twist.ad.</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.Delta">
<em class="property">classmethod </em><code class="sig-name descname">Delta</code><span class="sig-paren">(</span><em class="sig-param">d</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/pose3d.html#SE3.Delta"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.pose3d.SE3.Delta" title="Permalink to this definition">¶</a></dt>
<dd><p>Create SE(3) from diffential motion</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>d</strong> (<em>6-element array_like</em>) – differential motion</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>4x4 homogeneous transformation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>SE3 instance</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">T</span> <span class="pre">=</span> <span class="pre">delta2tr(d)</span></code> is an SE(3) representing differential 
motion <span class="math notranslate nohighlight">\(d = [\delta_x, \delta_y, \delta_z, \theta_x, \theta_y, \theta_z\)</span>.</p></li>
</ul>
<p>Reference: Robotics, Vision &amp; Control: Second Edition, P. Corke, Springer 2016; p67.</p>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.pose3d.SE3.delta" title="spatialmath.pose3d.SE3.delta"><code class="xref py py-func docutils literal notranslate"><span class="pre">delta()</span></code></a>, <code class="xref py py-func docutils literal notranslate"><span class="pre">delta2tr()</span></code></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.Empty">
<em class="property">classmethod </em><code class="sig-name descname">Empty</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SE3.Empty" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct a new pose object with zero items (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>cls</strong> (<a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2"><em>SO2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><em>SE2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3"><em>SO3</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SE3" title="spatialmath.pose3d.SE3"><em>SE3</em></a>) – The pose subclass</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>a pose with zero values</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2">SO2</a>, <a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2">SE2</a>, <a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3">SO3</a>, SE3 instance</p>
</dd>
</dl>
<p>This constructs an empty pose container which can be appended to.  For example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SO2</span><span class="o">.</span><span class="n">Empty</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">SO2</span><span class="p">(</span><span class="mi">20</span><span class="p">,</span> <span class="s1">&#39;deg&#39;</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">1</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.N">
<em class="property">property </em><code class="sig-name descname">N</code><a class="headerlink" href="#spatialmath.pose3d.SE3.N" title="Permalink to this definition">¶</a></dt>
<dd><p>Dimension of the object’s group (superclass property)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>dimension</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>int</p>
</dd>
</dl>
<p>Dimension of the group is 2 for <code class="docutils literal notranslate"><span class="pre">SO2</span></code> or <code class="docutils literal notranslate"><span class="pre">SE2</span></code>, and 3 for <code class="docutils literal notranslate"><span class="pre">SO3</span></code> or <code class="docutils literal notranslate"><span class="pre">SE3</span></code>.
This corresponds to the dimension of the space, 2D or 3D, to which these
rotations or rigid-body motions apply.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">N</span>
<span class="go">3</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.R">
<em class="property">property </em><code class="sig-name descname">R</code><a class="headerlink" href="#spatialmath.pose3d.SE3.R" title="Permalink to this definition">¶</a></dt>
<dd><p>SO(3) or SE(3) as rotation matrix</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>rotational component</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>numpy.ndarray, shape=(3,3)</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">x.R</span></code> returns the rotation matrix, when <cite>x</cite> is <cite>SO3</cite> or <cite>SE3</cite>. If <cite>len(x)</cite> is:</p>
<ul class="simple">
<li><p>1, return an ndarray with shape=(3,3)</p></li>
<li><p>N&gt;1, return ndarray with shape=(N,3,3)</p></li>
</ul>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.__add__">
<code class="sig-name descname">__add__</code><span class="sig-paren">(</span><em class="sig-param">right</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SE3.__add__" title="Permalink to this definition">¶</a></dt>
<dd><p>Overloaded <code class="docutils literal notranslate"><span class="pre">+</span></code> operator (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>left</strong> – left addend</p></li>
<li><p><strong>right</strong> – right addend</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>sum</p>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><strong>ValueError</strong> – for incompatible arguments</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy ndarray, shape=(N,N)</p>
</dd>
</dl>
<p>Add elements of two poses.  This is not a group operation so the
result is a matrix not a pose class.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">+</span> <span class="pre">Y</span></code> is the element-wise sum of the matrix value of <code class="docutils literal notranslate"><span class="pre">X</span></code> and <code class="docutils literal notranslate"><span class="pre">Y</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">+</span> <span class="pre">s</span></code> is the element-wise sum of the matrix value of <code class="docutils literal notranslate"><span class="pre">X</span></code> and <code class="docutils literal notranslate"><span class="pre">s</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">s</span> <span class="pre">+</span> <span class="pre">X</span></code> is the element-wise sum of the matrix value of <code class="docutils literal notranslate"><span class="pre">s</span></code> and <code class="docutils literal notranslate"><span class="pre">X</span></code></p></li>
</ul>
<table class="docutils align-default">
<colgroup>
<col style="width: 22%" />
<col style="width: 22%" />
<col style="width: 17%" />
<col style="width: 38%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head" colspan="2"><p>Operands</p></th>
<th class="head" colspan="2"><p>Sum</p></th>
</tr>
<tr class="row-even"><th class="head"><p>left</p></th>
<th class="head"><p>right</p></th>
<th class="head"><p>type</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-odd"><td><p>Pose</p></td>
<td><p>Pose</p></td>
<td><p>NxN matrix</p></td>
<td><p>element-wise matrix sum</p></td>
</tr>
<tr class="row-even"><td><p>Pose</p></td>
<td><p>scalar</p></td>
<td><p>NxN matrix</p></td>
<td><p>element-wise sum</p></td>
</tr>
<tr class="row-odd"><td><p>scalar</p></td>
<td><p>Pose</p></td>
<td><p>NxN matrix</p></td>
<td><p>element-wise sum</p></td>
</tr>
</tbody>
</table>
<p>Notes:</p>
<ol class="arabic simple">
<li><p>Pose is <code class="docutils literal notranslate"><span class="pre">SO2</span></code>, <code class="docutils literal notranslate"><span class="pre">SE2</span></code>, <code class="docutils literal notranslate"><span class="pre">SO3</span></code> or <code class="docutils literal notranslate"><span class="pre">SE3</span></code> instance</p></li>
<li><p>N is 2 for <code class="docutils literal notranslate"><span class="pre">SO2</span></code>, <code class="docutils literal notranslate"><span class="pre">SE2</span></code>; 3 for <code class="docutils literal notranslate"><span class="pre">SO3</span></code> or <code class="docutils literal notranslate"><span class="pre">SE3</span></code></p></li>
<li><p>scalar + Pose is handled by <code class="docutils literal notranslate"><span class="pre">__radd__</span></code></p></li>
<li><p>scalar addition is commutative</p></li>
<li><p>Any other input combinations result in a ValueError.</p></li>
</ol>
<p>For pose addition the <code class="docutils literal notranslate"><span class="pre">left</span></code> and <code class="docutils literal notranslate"><span class="pre">right</span></code> operands may be a sequence which
results in the result being a sequence:</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 16%" />
<col style="width: 18%" />
<col style="width: 7%" />
<col style="width: 58%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>len(left)</p></th>
<th class="head"><p>len(right)</p></th>
<th class="head"><p>len</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">+</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">+</span> <span class="pre">right[i]</span></code></p></td>
</tr>
<tr class="row-even"><td><p>N</p></td>
<td><p>1</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">+</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>M</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">+</span> <span class="pre">right[i]</span></code></p></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.__eq__">
<code class="sig-name descname">__eq__</code><span class="sig-paren">(</span><em class="sig-param">right</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SE3.__eq__" title="Permalink to this definition">¶</a></dt>
<dd><p>Overloaded <code class="docutils literal notranslate"><span class="pre">==</span></code> operator (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>left</strong> – left side of comparison</p></li>
<li><p><strong>right</strong> – right side of comparison</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>poses are equal</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
<p>Test two poses for equality</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">==</span> <span class="pre">Y</span></code> is true of the poses are of the same type and numerically
equal.</p></li>
</ul>
<p>If either operand contains a sequence the results is a sequence 
according to:</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 16%" />
<col style="width: 18%" />
<col style="width: 7%" />
<col style="width: 58%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>len(left)</p></th>
<th class="head"><p>len(right)</p></th>
<th class="head"><p>len</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">ret</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">==</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">ret[i]</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">==</span> <span class="pre">right[i]</span></code></p></td>
</tr>
<tr class="row-even"><td><p>N</p></td>
<td><p>1</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">ret[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">==</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>M</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">ret[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">==</span> <span class="pre">right[i]</span></code></p></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.__mul__">
<code class="sig-name descname">__mul__</code><span class="sig-paren">(</span><em class="sig-param">right</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SE3.__mul__" title="Permalink to this definition">¶</a></dt>
<dd><p>Overloaded <code class="docutils literal notranslate"><span class="pre">*</span></code> operator (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>left</strong> – left multiplicand</p></li>
<li><p><strong>right</strong> – right multiplicand</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>product</p>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p>ValueError</p>
</dd>
</dl>
<p>Pose composition, scaling or vector transformation:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">*</span> <span class="pre">Y</span></code> compounds the poses <code class="docutils literal notranslate"><span class="pre">X</span></code> and <code class="docutils literal notranslate"><span class="pre">Y</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">*</span> <span class="pre">s</span></code> performs elementwise multiplication of the elements of <code class="docutils literal notranslate"><span class="pre">X</span></code> by <code class="docutils literal notranslate"><span class="pre">s</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">s</span> <span class="pre">*</span> <span class="pre">X</span></code> performs elementwise multiplication of the elements of <code class="docutils literal notranslate"><span class="pre">X</span></code> by <code class="docutils literal notranslate"><span class="pre">s</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">*</span> <span class="pre">v</span></code> linear transform of the vector <code class="docutils literal notranslate"><span class="pre">v</span></code></p></li>
</ul>
<table class="docutils align-default">
<colgroup>
<col style="width: 23%" />
<col style="width: 23%" />
<col style="width: 18%" />
<col style="width: 36%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head" colspan="2"><p>Multiplicands</p></th>
<th class="head" colspan="2"><p>Product</p></th>
</tr>
<tr class="row-even"><th class="head"><p>left</p></th>
<th class="head"><p>right</p></th>
<th class="head"><p>type</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-odd"><td><p>Pose</p></td>
<td><p>Pose</p></td>
<td><p>Pose</p></td>
<td><p>matrix product</p></td>
</tr>
<tr class="row-even"><td><p>Pose</p></td>
<td><p>scalar</p></td>
<td><p>NxN matrix</p></td>
<td><p>element-wise product</p></td>
</tr>
<tr class="row-odd"><td><p>scalar</p></td>
<td><p>Pose</p></td>
<td><p>NxN matrix</p></td>
<td><p>element-wise product</p></td>
</tr>
<tr class="row-even"><td><p>Pose</p></td>
<td><p>N-vector</p></td>
<td><p>N-vector</p></td>
<td><p>vector transform</p></td>
</tr>
<tr class="row-odd"><td><p>Pose</p></td>
<td><p>NxM matrix</p></td>
<td><p>NxM matrix</p></td>
<td><p>transform each column</p></td>
</tr>
</tbody>
</table>
<p>Notes:</p>
<ol class="arabic simple">
<li><p>Pose is <code class="docutils literal notranslate"><span class="pre">SO2</span></code>, <code class="docutils literal notranslate"><span class="pre">SE2</span></code>, <code class="docutils literal notranslate"><span class="pre">SO3</span></code> or <code class="docutils literal notranslate"><span class="pre">SE3</span></code> instance</p></li>
<li><p>N is 2 for <code class="docutils literal notranslate"><span class="pre">SO2</span></code>, <code class="docutils literal notranslate"><span class="pre">SE2</span></code>; 3 for <code class="docutils literal notranslate"><span class="pre">SO3</span></code> or <code class="docutils literal notranslate"><span class="pre">SE3</span></code></p></li>
<li><p>scalar x Pose is handled by <code class="docutils literal notranslate"><span class="pre">__rmul__</span></code></p></li>
<li><p>scalar multiplication is commutative but the result is not a group
operation so the result will be a matrix</p></li>
<li><p>Any other input combinations result in a ValueError.</p></li>
</ol>
<p>For pose composition the <code class="docutils literal notranslate"><span class="pre">left</span></code> and <code class="docutils literal notranslate"><span class="pre">right</span></code> operands may be a sequence</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 16%" />
<col style="width: 18%" />
<col style="width: 7%" />
<col style="width: 58%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>len(left)</p></th>
<th class="head"><p>len(right)</p></th>
<th class="head"><p>len</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">*</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">*</span> <span class="pre">right[i]</span></code></p></td>
</tr>
<tr class="row-even"><td><p>N</p></td>
<td><p>1</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">*</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>M</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">*</span> <span class="pre">right[i]</span></code></p></td>
</tr>
</tbody>
</table>
<p>For vector transformation there are three cases</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 18%" />
<col style="width: 22%" />
<col style="width: 10%" />
<col style="width: 51%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head" colspan="2"><p>Multiplicands</p></th>
<th class="head" colspan="2"><p>Product</p></th>
</tr>
<tr class="row-even"><th class="head"><p>len(left)</p></th>
<th class="head"><p>right.shape</p></th>
<th class="head"><p>shape</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-odd"><td><p>1</p></td>
<td><p>(N,)</p></td>
<td><p>(N,)</p></td>
<td><p>vector transformation</p></td>
</tr>
<tr class="row-even"><td><p>M</p></td>
<td><p>(N,)</p></td>
<td><p>(N,M)</p></td>
<td><p>vector transformations</p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>(N,M)</p></td>
<td><p>(N,M)</p></td>
<td><p>column transformation</p></td>
</tr>
</tbody>
</table>
<p>Notes:</p>
<ol class="arabic simple">
<li><p>for the <code class="docutils literal notranslate"><span class="pre">SE2</span></code> and <code class="docutils literal notranslate"><span class="pre">SE3</span></code> case the vectors are converted to homogeneous
form, transformed, then converted back to Euclidean form.</p></li>
</ol>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.__ne__">
<code class="sig-name descname">__ne__</code><span class="sig-paren">(</span><em class="sig-param">right</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SE3.__ne__" title="Permalink to this definition">¶</a></dt>
<dd><p>Overloaded <code class="docutils literal notranslate"><span class="pre">!=</span></code> operator</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>left</strong> – left side of comparison</p></li>
<li><p><strong>right</strong> – right side of comparison</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>poses are not equal</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
<p>Test two poses for inequality</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">==</span> <span class="pre">Y</span></code> is true of the poses are of the same type but not numerically
equal.</p></li>
</ul>
<p>If either operand contains a sequence the results is a sequence 
according to:</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 16%" />
<col style="width: 18%" />
<col style="width: 7%" />
<col style="width: 58%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>len(left)</p></th>
<th class="head"><p>len(right)</p></th>
<th class="head"><p>len</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">ret</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">!=</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">ret[i]</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">!=</span> <span class="pre">right[i]</span></code></p></td>
</tr>
<tr class="row-even"><td><p>N</p></td>
<td><p>1</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">ret[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">!=</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>M</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">ret[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">!=</span> <span class="pre">right[i]</span></code></p></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.__pow__">
<code class="sig-name descname">__pow__</code><span class="sig-paren">(</span><em class="sig-param">n</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SE3.__pow__" title="Permalink to this definition">¶</a></dt>
<dd><p>Overloaded <code class="docutils literal notranslate"><span class="pre">**</span></code> operator (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>n</strong> – pose</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>pose to the power n</p>
</dd>
</dl>
<p>Raise all elements of pose to the specified power.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X**n</span></code> raise all values in <code class="docutils literal notranslate"><span class="pre">X</span></code> to the power <code class="docutils literal notranslate"><span class="pre">n</span></code></p></li>
</ul>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.__sub__">
<code class="sig-name descname">__sub__</code><span class="sig-paren">(</span><em class="sig-param">right</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SE3.__sub__" title="Permalink to this definition">¶</a></dt>
<dd><p>Overloaded <code class="docutils literal notranslate"><span class="pre">-</span></code> operator (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>left</strong> – left minuend</p></li>
<li><p><strong>right</strong> – right subtrahend</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>difference</p>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><strong>ValueError</strong> – for incompatible arguments</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy ndarray, shape=(N,N)</p>
</dd>
</dl>
<p>Subtract elements of two poses.  This is not a group operation so the
result is a matrix not a pose class.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">-</span> <span class="pre">Y</span></code> is the element-wise difference of the matrix value of <code class="docutils literal notranslate"><span class="pre">X</span></code> and <code class="docutils literal notranslate"><span class="pre">Y</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">-</span> <span class="pre">s</span></code> is the element-wise difference of the matrix value of <code class="docutils literal notranslate"><span class="pre">X</span></code> and <code class="docutils literal notranslate"><span class="pre">s</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">s</span> <span class="pre">-</span> <span class="pre">X</span></code> is the element-wise difference of <code class="docutils literal notranslate"><span class="pre">s</span></code> and the matrix value of <code class="docutils literal notranslate"><span class="pre">X</span></code></p></li>
</ul>
<table class="docutils align-default">
<colgroup>
<col style="width: 20%" />
<col style="width: 20%" />
<col style="width: 16%" />
<col style="width: 43%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head" colspan="2"><p>Operands</p></th>
<th class="head" colspan="2"><p>Sum</p></th>
</tr>
<tr class="row-even"><th class="head"><p>left</p></th>
<th class="head"><p>right</p></th>
<th class="head"><p>type</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-odd"><td><p>Pose</p></td>
<td><p>Pose</p></td>
<td><p>NxN matrix</p></td>
<td><p>element-wise matrix difference</p></td>
</tr>
<tr class="row-even"><td><p>Pose</p></td>
<td><p>scalar</p></td>
<td><p>NxN matrix</p></td>
<td><p>element-wise sum</p></td>
</tr>
<tr class="row-odd"><td><p>scalar</p></td>
<td><p>Pose</p></td>
<td><p>NxN matrix</p></td>
<td><p>element-wise sum</p></td>
</tr>
</tbody>
</table>
<p>Notes:</p>
<ol class="arabic simple">
<li><p>Pose is <code class="docutils literal notranslate"><span class="pre">SO2</span></code>, <code class="docutils literal notranslate"><span class="pre">SE2</span></code>, <code class="docutils literal notranslate"><span class="pre">SO3</span></code> or <code class="docutils literal notranslate"><span class="pre">SE3</span></code> instance</p></li>
<li><p>N is 2 for <code class="docutils literal notranslate"><span class="pre">SO2</span></code>, <code class="docutils literal notranslate"><span class="pre">SE2</span></code>; 3 for <code class="docutils literal notranslate"><span class="pre">SO3</span></code> or <code class="docutils literal notranslate"><span class="pre">SE3</span></code></p></li>
<li><p>scalar - Pose is handled by <code class="docutils literal notranslate"><span class="pre">__rsub__</span></code></p></li>
<li><p>Any other input combinations result in a ValueError.</p></li>
</ol>
<p>For pose addition the <code class="docutils literal notranslate"><span class="pre">left</span></code> and <code class="docutils literal notranslate"><span class="pre">right</span></code> operands may be a sequence which
results in the result being a sequence:</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 16%" />
<col style="width: 18%" />
<col style="width: 7%" />
<col style="width: 58%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>len(left)</p></th>
<th class="head"><p>len(right)</p></th>
<th class="head"><p>len</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">-</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">-</span> <span class="pre">right[i]</span></code></p></td>
</tr>
<tr class="row-even"><td><p>N</p></td>
<td><p>1</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">-</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>M</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span>&#160; <span class="pre">right[i]</span></code></p></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.__truediv__">
<code class="sig-name descname">__truediv__</code><span class="sig-paren">(</span><em class="sig-param">right</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SE3.__truediv__" title="Permalink to this definition">¶</a></dt>
<dd><p>Overloaded <code class="docutils literal notranslate"><span class="pre">/</span></code> operator (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>left</strong> – left multiplicand</p></li>
<li><p><strong>right</strong> – right multiplicand</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>product</p>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><strong>ValueError</strong> – for incompatible arguments</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy ndarray</p>
</dd>
</dl>
<p>Pose composition or scaling:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">/</span> <span class="pre">Y</span></code> compounds the poses <code class="docutils literal notranslate"><span class="pre">X</span></code> and <code class="docutils literal notranslate"><span class="pre">Y.inv()</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">X</span> <span class="pre">/</span> <span class="pre">s</span></code> performs elementwise multiplication of the elements of <code class="docutils literal notranslate"><span class="pre">X</span></code> by <code class="docutils literal notranslate"><span class="pre">s</span></code></p></li>
</ul>
<table class="docutils align-default">
<colgroup>
<col style="width: 22%" />
<col style="width: 22%" />
<col style="width: 17%" />
<col style="width: 39%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head" colspan="2"><p>Multiplicands</p></th>
<th class="head" colspan="2"><p>Quotient</p></th>
</tr>
<tr class="row-even"><th class="head"><p>left</p></th>
<th class="head"><p>right</p></th>
<th class="head"><p>type</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-odd"><td><p>Pose</p></td>
<td><p>Pose</p></td>
<td><p>Pose</p></td>
<td><p>matrix product by inverse</p></td>
</tr>
<tr class="row-even"><td><p>Pose</p></td>
<td><p>scalar</p></td>
<td><p>NxN matrix</p></td>
<td><p>element-wise division</p></td>
</tr>
</tbody>
</table>
<p>Notes:</p>
<ol class="arabic simple">
<li><p>Pose is <code class="docutils literal notranslate"><span class="pre">SO2</span></code>, <code class="docutils literal notranslate"><span class="pre">SE2</span></code>, <code class="docutils literal notranslate"><span class="pre">SO3</span></code> or <code class="docutils literal notranslate"><span class="pre">SE3</span></code> instance</p></li>
<li><p>N is 2 for <code class="docutils literal notranslate"><span class="pre">SO2</span></code>, <code class="docutils literal notranslate"><span class="pre">SE2</span></code>; 3 for <code class="docutils literal notranslate"><span class="pre">SO3</span></code> or <code class="docutils literal notranslate"><span class="pre">SE3</span></code></p></li>
<li><p>scalar multiplication is not a group operation so the result will 
be a matrix</p></li>
<li><p>Any other input combinations result in a ValueError.</p></li>
</ol>
<p>For pose composition the <code class="docutils literal notranslate"><span class="pre">left</span></code> and <code class="docutils literal notranslate"><span class="pre">right</span></code> operands may be a sequence</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 15%" />
<col style="width: 16%" />
<col style="width: 7%" />
<col style="width: 62%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>len(left)</p></th>
<th class="head"><p>len(right)</p></th>
<th class="head"><p>len</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">*</span> <span class="pre">right.inv()</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">*</span> <span class="pre">right[i].inv()</span></code></p></td>
</tr>
<tr class="row-even"><td><p>N</p></td>
<td><p>1</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">*</span> <span class="pre">right.inv()</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>M</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">*</span> <span class="pre">right[i].inv()</span></code></p></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.a">
<em class="property">property </em><code class="sig-name descname">a</code><a class="headerlink" href="#spatialmath.pose3d.SE3.a" title="Permalink to this definition">¶</a></dt>
<dd><p>Approach vector of SO(3) or SE(3)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>approach vector</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>numpy.ndarray, shape=(3,)</p>
</dd>
</dl>
<p>Is the third column of the rotation submatrix, sometimes called the approach
vector.  Parallel to the z-axis of the frame defined by this pose.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.about">
<em class="property">property </em><code class="sig-name descname">about</code><a class="headerlink" href="#spatialmath.pose3d.SE3.about" title="Permalink to this definition">¶</a></dt>
<dd><p>Succinct summary of object type and length (superclass property)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>succinct summary</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>str</p>
</dd>
</dl>
<p>Displays the type and the number of elements in compact form, for 
example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">([</span><span class="n">SE3</span><span class="p">()</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">20</span><span class="p">)])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">20</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">x</span><span class="o">.</span><span class="n">about</span><span class="p">)</span>
<span class="go">SE3[20]</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.animate">
<code class="sig-name descname">animate</code><span class="sig-paren">(</span><em class="sig-param">*args</em>, <em class="sig-param">T0=None</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SE3.animate" title="Permalink to this definition">¶</a></dt>
<dd><p>Plot pose object as an animated coordinate frame (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>**kwargs</strong> – plotting options</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X.plot()</span></code> displays the pose <code class="docutils literal notranslate"><span class="pre">X</span></code> as a coordinate frame moving
from the origin, or <code class="docutils literal notranslate"><span class="pre">T0</span></code>, in either 2D or 3D axes.  There are 
many options, see the links below.</p></li>
</ul>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">X</span> <span class="o">=</span> <span class="n">SE3</span><span class="o">.</span><span class="n">Rx</span><span class="p">(</span><span class="mf">0.3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">X</span><span class="o">.</span><span class="n">animate</span><span class="p">(</span><span class="n">frame</span><span class="o">=</span><span class="s1">&#39;A&#39;</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s1">&#39;green&#39;</span><span class="p">)</span>
</pre></div>
</div>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.tranimate" title="spatialmath.base.transforms3d.tranimate"><code class="xref py py-func docutils literal notranslate"><span class="pre">tranimate()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms2d.tranimate2" title="spatialmath.base.transforms2d.tranimate2"><code class="xref py py-func docutils literal notranslate"><span class="pre">tranimate2()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.append">
<code class="sig-name descname">append</code><span class="sig-paren">(</span><em class="sig-param">x</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SE3.append" title="Permalink to this definition">¶</a></dt>
<dd><p>Append a value to a pose object (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>x</strong> (<a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2"><em>SO2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><em>SE2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3"><em>SO3</em></a><em>, </em><em>SE3 instance</em>) – the value to append</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>ValueError</strong> – incorrect type of appended object</p>
</dd>
</dl>
<p>Appends the argument to the object’s internal list of values.</p>
<p>Examples:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">SE3</span><span class="o">.</span><span class="n">Rx</span><span class="p">(</span><span class="mf">0.1</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">2</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.clear">
<code class="sig-name descname">clear</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None -- remove all items from S<a class="headerlink" href="#spatialmath.pose3d.SE3.clear" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.eul">
<code class="sig-name descname">eul</code><span class="sig-paren">(</span><em class="sig-param">unit='deg'</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SE3.eul" title="Permalink to this definition">¶</a></dt>
<dd><p>SO(3) or SE(3) as Euler angles</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>3-vector of Euler angles</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(3,)</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">x.eul</span></code> is the Euler angle representation of the rotation.  Euler angles are
a 3-vector <span class="math notranslate nohighlight">\((\phi,        heta, \psi)\)</span> which correspond to consecutive
rotations about the Z, Y, Z axes respectively.</p>
<p>If <cite>len(x)</cite> is:</p>
<ul class="simple">
<li><p>1, return an ndarray with shape=(3,)</p></li>
<li><p>N&gt;1, return ndarray with shape=(N,3)</p></li>
<li><p>ndarray with shape=(3,), if len(R) == 1</p></li>
<li><p>ndarray with shape=(N,3), if len(R) = N &gt; 1</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.pose3d.SE3.Eul" title="spatialmath.pose3d.SE3.Eul"><code class="xref py py-func docutils literal notranslate"><span class="pre">Eul()</span></code></a>, :<a class="reference internal" href="#spatialmath.base.transforms3d.tr2eul" title="spatialmath.base.transforms3d.tr2eul"><code class="xref py py-func docutils literal notranslate"><span class="pre">spatialmath.base.transforms3d.tr2eul()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.extend">
<code class="sig-name descname">extend</code><span class="sig-paren">(</span><em class="sig-param">x</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SE3.extend" title="Permalink to this definition">¶</a></dt>
<dd><p>Extend sequence of values of a pose object (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>x</strong> (<a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2"><em>SO2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><em>SE2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3"><em>SO3</em></a><em>, </em><em>SE3 instance</em>) – the value to extend</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>ValueError</strong> – incorrect type of appended object</p>
</dd>
</dl>
<p>Appends the argument to the object’s internal list of values.</p>
<p>Examples:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">SE3</span><span class="o">.</span><span class="n">Rx</span><span class="p">(</span><span class="mf">0.1</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">2</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.insert">
<code class="sig-name descname">insert</code><span class="sig-paren">(</span><em class="sig-param">i</em>, <em class="sig-param">value</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SE3.insert" title="Permalink to this definition">¶</a></dt>
<dd><p>Insert a value to a pose object (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>i</strong> (<em>int</em>) – element to insert value before</p></li>
<li><p><strong>value</strong> (<a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2"><em>SO2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><em>SE2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3"><em>SO3</em></a><em>, </em><em>SE3 instance</em>) – the value to insert</p></li>
</ul>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>ValueError</strong> – incorrect type of inserted value</p>
</dd>
</dl>
<p>Inserts the argument into the object’s internal list of values.</p>
<p>Examples:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">inert</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">SE3</span><span class="o">.</span><span class="n">Rx</span><span class="p">(</span><span class="mf">0.1</span><span class="p">))</span> <span class="c1"># insert at position 0 in the list</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">2</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.interp">
<code class="sig-name descname">interp</code><span class="sig-paren">(</span><em class="sig-param">s=None</em>, <em class="sig-param">T0=None</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SE3.interp" title="Permalink to this definition">¶</a></dt>
<dd><p>Interpolate pose (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>T0</strong> (<a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2"><em>SO2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><em>SE2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3"><em>SO3</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SE3" title="spatialmath.pose3d.SE3"><em>SE3</em></a>) – initial pose</p></li>
<li><p><strong>s</strong> (<em>float</em><em> or </em><em>array_like</em>) – interpolation coefficient, range 0 to 1</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>interpolated pose</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2">SO2</a>, <a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2">SE2</a>, <a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3">SO3</a>, SE3 instance</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X.interp(s)</span></code> interpolates the pose X between identity when s=0
and X when s=1.</p></li>
</ul>
<blockquote>
<div><table class="docutils align-default">
<colgroup>
<col style="width: 11%" />
<col style="width: 11%" />
<col style="width: 20%" />
<col style="width: 57%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>len(X)</p></th>
<th class="head"><p>len(s)</p></th>
<th class="head"><p>len(result)</p></th>
<th class="head"><p>Result</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p>Y = interp(identity, X, s)</p></td>
</tr>
<tr class="row-odd"><td><p>M</p></td>
<td><p>1</p></td>
<td><p>M</p></td>
<td><p>Y[i] = interp(T0, X[i], s)</p></td>
</tr>
<tr class="row-even"><td><p>1</p></td>
<td><p>M</p></td>
<td><p>M</p></td>
<td><p>Y[i] = interp(T0, X, s[i])</p></td>
</tr>
</tbody>
</table>
</div></blockquote>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="o">.</span><span class="n">Rx</span><span class="p">(</span><span class="mf">0.3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">x</span><span class="o">.</span><span class="n">interp</span><span class="p">(</span><span class="mi">0</span><span class="p">))</span>
<span class="go">SE3(array([[1., 0., 0., 0.],</span>
<span class="go">           [0., 1., 0., 0.],</span>
<span class="go">           [0., 0., 1., 0.],</span>
<span class="go">           [0., 0., 0., 1.]]))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">x</span><span class="o">.</span><span class="n">interp</span><span class="p">(</span><span class="mi">1</span><span class="p">))</span>
<span class="go">SE3(array([[ 1.        ,  0.        ,  0.        ,  0.        ],</span>
<span class="go">           [ 0.        ,  0.95533649, -0.29552021,  0.        ],</span>
<span class="go">           [ 0.        ,  0.29552021,  0.95533649,  0.        ],</span>
<span class="go">           [ 0.        ,  0.        ,  0.        ,  1.        ]]))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span> <span class="o">=</span> <span class="n">x</span><span class="o">.</span><span class="n">interp</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">linspace</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">10</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">y</span><span class="p">)</span>
<span class="go">10</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span><span class="p">[</span><span class="mi">5</span><span class="p">]</span>
<span class="go">SE3(array([[ 1.        ,  0.        ,  0.        ,  0.        ],</span>
<span class="go">           [ 0.        ,  0.98614323, -0.16589613,  0.        ],</span>
<span class="go">           [ 0.        ,  0.16589613,  0.98614323,  0.        ],</span>
<span class="go">           [ 0.        ,  0.        ,  0.        ,  1.        ]]))</span>
</pre></div>
</div>
<p>Notes:</p>
<ol class="arabic simple">
<li><p>For SO3 and SE3 rotation is interpolated using quaternion spherical linear interpolation (slerp).</p></li>
</ol>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.trinterp" title="spatialmath.base.transforms3d.trinterp"><code class="xref py py-func docutils literal notranslate"><span class="pre">trinterp()</span></code></a>, <a class="reference internal" href="#spatialmath.base.quaternions.slerp" title="spatialmath.base.quaternions.slerp"><code class="xref py py-func docutils literal notranslate"><span class="pre">spatialmath.base.quaternions.slerp()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms2d.trinterp2" title="spatialmath.base.transforms2d.trinterp2"><code class="xref py py-func docutils literal notranslate"><span class="pre">trinterp2()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.isSE">
<em class="property">property </em><code class="sig-name descname">isSE</code><a class="headerlink" href="#spatialmath.pose3d.SE3.isSE" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if object belongs to SE(n) group (superclass property)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>self</strong> (<a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2"><em>SO2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><em>SE2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3"><em>SO3</em></a><em>, </em><em>SE3 instance</em>) – object to test</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">True</span></code> if object is instance of SE2 or SE3</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.isSO">
<em class="property">property </em><code class="sig-name descname">isSO</code><a class="headerlink" href="#spatialmath.pose3d.SE3.isSO" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if object belongs to SO(n) group (superclass property)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>self</strong> (<a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2"><em>SO2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2"><em>SE2</em></a><em>, </em><a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3"><em>SO3</em></a><em>, </em><em>SE3 instance</em>) – object to test</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">True</span></code> if object is instance of SO2 or SO3</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.ishom">
<code class="sig-name descname">ishom</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SE3.ishom" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if object belongs to SE(3) group (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">True</span></code> if object is instance of SE3</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>bool</p>
</dd>
</dl>
<p>For compatibility with Spatial Math Toolbox for MATLAB.
In Python use <code class="docutils literal notranslate"><span class="pre">isinstance(x,</span> <span class="pre">SE3)</span></code>.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SO3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">isrot</span><span class="p">()</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">isrot</span><span class="p">()</span>
<span class="go">True</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.ishom2">
<code class="sig-name descname">ishom2</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SE3.ishom2" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if object belongs to SE(2) group (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">True</span></code> if object is instance of SE2</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>bool</p>
</dd>
</dl>
<p>For compatibility with Spatial Math Toolbox for MATLAB.
In Python use <code class="docutils literal notranslate"><span class="pre">isinstance(x,</span> <span class="pre">SE2)</span></code>.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SO2</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">isrot</span><span class="p">()</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE2</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">isrot</span><span class="p">()</span>
<span class="go">True</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.isrot">
<code class="sig-name descname">isrot</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SE3.isrot" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if object belongs to SO(3) group (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">True</span></code> if object is instance of SO3</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>bool</p>
</dd>
</dl>
<p>For compatibility with Spatial Math Toolbox for MATLAB.
In Python use <code class="docutils literal notranslate"><span class="pre">isinstance(x,</span> <span class="pre">SO3)</span></code>.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SO3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">isrot</span><span class="p">()</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">isrot</span><span class="p">()</span>
<span class="go">False</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.isrot2">
<code class="sig-name descname">isrot2</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SE3.isrot2" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if object belongs to SO(2) group (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">True</span></code> if object is instance of SO2</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>bool</p>
</dd>
</dl>
<p>For compatibility with Spatial Math Toolbox for MATLAB.
In Python use <code class="docutils literal notranslate"><span class="pre">isinstance(x,</span> <span class="pre">SO2)</span></code>.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SO2</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">isrot</span><span class="p">()</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE2</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">isrot</span><span class="p">()</span>
<span class="go">False</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.log">
<code class="sig-name descname">log</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SE3.log" title="Permalink to this definition">¶</a></dt>
<dd><p>Logarithm of pose (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>logarithm</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>numpy.ndarray</p>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p>ValueError</p>
</dd>
</dl>
<p>An efficient closed-form solution of the matrix logarithm.</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 12%" />
<col style="width: 14%" />
<col style="width: 74%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Input</p></th>
<th class="head" colspan="2"><p>Output</p></th>
</tr>
<tr class="row-even"><th class="head"><p>Pose</p></th>
<th class="head"><p>Shape</p></th>
<th class="head"><p>Structure</p></th>
</tr>
</thead>
<tbody>
<tr class="row-odd"><td><p>SO2</p></td>
<td><p>(2,2)</p></td>
<td><p>skew-symmetric</p></td>
</tr>
<tr class="row-even"><td><p>SE2</p></td>
<td><p>(3,3)</p></td>
<td><p>augmented skew-symmetric</p></td>
</tr>
<tr class="row-odd"><td><p>SO3</p></td>
<td><p>(3,3)</p></td>
<td><p>skew-symmetric</p></td>
</tr>
<tr class="row-even"><td><p>SE3</p></td>
<td><p>(4,4)</p></td>
<td><p>augmented skew-symmetric</p></td>
</tr>
</tbody>
</table>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="o">.</span><span class="n">Rx</span><span class="p">(</span><span class="mf">0.3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span> <span class="o">=</span> <span class="n">x</span><span class="o">.</span><span class="n">log</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span>
<span class="go">array([[ 0. , -0. ,  0. ,  0. ],</span>
<span class="go">       [ 0. ,  0. , -0.3,  0. ],</span>
<span class="go">       [-0. ,  0.3,  0. ,  0. ],</span>
<span class="go">       [ 0. ,  0. ,  0. ,  0. ]])</span>
</pre></div>
</div>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms2d.trlog2" title="spatialmath.base.transforms2d.trlog2"><code class="xref py py-func docutils literal notranslate"><span class="pre">trlog2()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms3d.trlog" title="spatialmath.base.transforms3d.trlog"><code class="xref py py-func docutils literal notranslate"><span class="pre">trlog()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.n">
<em class="property">property </em><code class="sig-name descname">n</code><a class="headerlink" href="#spatialmath.pose3d.SE3.n" title="Permalink to this definition">¶</a></dt>
<dd><p>Normal vector of SO(3) or SE(3)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>normal vector</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>numpy.ndarray, shape=(3,)</p>
</dd>
</dl>
<p>Is the first column of the rotation submatrix, sometimes called the normal
vector.  Parallel to the x-axis of the frame defined by this pose.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.norm">
<code class="sig-name descname">norm</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SE3.norm" title="Permalink to this definition">¶</a></dt>
<dd><p>Normalize pose (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>pose</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2">SO2</a>, <a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2">SE2</a>, <a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3">SO3</a>, SE3 instance</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X.norm()</span></code> is an equivalent pose object but the rotational matrix 
part of all values has been adjusted to ensure it is a proper orthogonal
matrix rotation.</p></li>
</ul>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span> <span class="o">=</span> <span class="n">x</span><span class="o">.</span><span class="n">norm</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span>
<span class="go">SE3(array([[1., 0., 0., 0.],</span>
<span class="go">           [0., 1., 0., 0.],</span>
<span class="go">           [0., 0., 1., 0.],</span>
<span class="go">           [0., 0., 0., 1.]]))</span>
</pre></div>
</div>
<p>Notes:</p>
<ol class="arabic simple">
<li><p>Only the direction of A vector (the z-axis) is unchanged.</p></li>
<li><p>Used to prevent finite word length arithmetic causing transforms to 
become ‘unnormalized’.</p></li>
</ol>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.trnorm" title="spatialmath.base.transforms3d.trnorm"><code class="xref py py-func docutils literal notranslate"><span class="pre">trnorm()</span></code></a>, <code class="xref py py-func docutils literal notranslate"><span class="pre">trnorm2()</span></code></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.o">
<em class="property">property </em><code class="sig-name descname">o</code><a class="headerlink" href="#spatialmath.pose3d.SE3.o" title="Permalink to this definition">¶</a></dt>
<dd><p>Orientation vector of SO(3) or SE(3)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>orientation vector</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>numpy.ndarray, shape=(3,)</p>
</dd>
</dl>
<p>Is the second column of the rotation submatrix, sometimes called the orientation
vector.  Parallel to the y-axis of the frame defined by this pose.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.plot">
<code class="sig-name descname">plot</code><span class="sig-paren">(</span><em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SE3.plot" title="Permalink to this definition">¶</a></dt>
<dd><p>Plot pose object as a coordinate frame (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>**kwargs</strong> – plotting options</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X.plot()</span></code> displays the pose <code class="docutils literal notranslate"><span class="pre">X</span></code> as a coordinate frame in either
2D or 3D axes.  There are many options, see the links below.</p></li>
</ul>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">X</span> <span class="o">=</span> <span class="n">SE3</span><span class="o">.</span><span class="n">Rx</span><span class="p">(</span><span class="mf">0.3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">X</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">frame</span><span class="o">=</span><span class="s1">&#39;A&#39;</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="s1">&#39;green&#39;</span><span class="p">)</span>
</pre></div>
</div>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.trplot" title="spatialmath.base.transforms3d.trplot"><code class="xref py py-func docutils literal notranslate"><span class="pre">trplot()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms2d.trplot2" title="spatialmath.base.transforms2d.trplot2"><code class="xref py py-func docutils literal notranslate"><span class="pre">trplot2()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.pop">
<code class="sig-name descname">pop</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SE3.pop" title="Permalink to this definition">¶</a></dt>
<dd><p>Pop value of a pose object (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>the specific element of the pose</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference internal" href="#spatialmath.pose2d.SO2" title="spatialmath.pose2d.SO2">SO2</a>, <a class="reference internal" href="#spatialmath.pose2d.SE2" title="spatialmath.pose2d.SE2">SE2</a>, <a class="reference internal" href="#spatialmath.pose3d.SO3" title="spatialmath.pose3d.SO3">SO3</a>, SE3 instance</p>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><strong>IndexError</strong> – if there are no values to pop</p>
</dd>
</dl>
<p>Removes the first pose value from the sequence in the pose object.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="o">.</span><span class="n">Rx</span><span class="p">([</span><span class="mi">0</span><span class="p">,</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="o">/</span><span class="mi">2</span><span class="p">,</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">3</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span> <span class="o">=</span> <span class="n">x</span><span class="o">.</span><span class="n">pop</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span>
<span class="go">SE3(array([[ 1.0000000e+00,  0.0000000e+00,  0.0000000e+00,  0.0000000e+00],</span>
<span class="go">           [ 0.0000000e+00, -1.0000000e+00, -1.2246468e-16,  0.0000000e+00],</span>
<span class="go">           [ 0.0000000e+00,  1.2246468e-16, -1.0000000e+00,  0.0000000e+00],</span>
<span class="go">           [ 0.0000000e+00,  0.0000000e+00,  0.0000000e+00,  1.0000000e+00]]))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">2</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.printline">
<code class="sig-name descname">printline</code><span class="sig-paren">(</span><em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SE3.printline" title="Permalink to this definition">¶</a></dt>
<dd><p>Print pose as a single line (superclass method)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>label</strong> (<em>str</em>) – text label to put at start of line</p></li>
<li><p><strong>file</strong> (<em>str</em>) – file to write formatted string to. [default, stdout]</p></li>
<li><p><strong>fmt</strong> (<em>str</em>) – conversion format for each number as used by <code class="docutils literal notranslate"><span class="pre">format()</span></code></p></li>
<li><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>optional formatted string</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
<p>For SO(3) or SE(3) also:</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>orient</strong> (<em>str</em>) – 3-angle convention to use</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">X.printline()</span></code> print <code class="docutils literal notranslate"><span class="pre">X</span></code> in single-line format to <code class="docutils literal notranslate"><span class="pre">stdout</span></code>, followed
by a newline</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">X.printline(file=None)</span></code> return a string containing <code class="docutils literal notranslate"><span class="pre">X</span></code> in 
single-line format</p></li>
</ul>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">=</span><span class="n">SE3</span><span class="o">.</span><span class="n">Rx</span><span class="p">(</span><span class="mf">0.3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">printline</span><span class="p">()</span>
<span class="go">t =        0,        0,        0; rpy/zyx =       17,        0,        0 deg</span>
</pre></div>
</div>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.reverse">
<code class="sig-name descname">reverse</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SE3.reverse" title="Permalink to this definition">¶</a></dt>
<dd><p>S.reverse() – reverse <em>IN PLACE</em></p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.rpy">
<code class="sig-name descname">rpy</code><span class="sig-paren">(</span><em class="sig-param">unit='deg'</em>, <em class="sig-param">order='zyx'</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.pose3d.SE3.rpy" title="Permalink to this definition">¶</a></dt>
<dd><p>SO(3) or SE(3) as roll-pitch-yaw angles</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>order</strong> (<em>str</em>) – angle sequence order, default to ‘zyx’</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>3-vector of roll-pitch-yaw angles</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(3,)</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">x.rpy</span></code> is the roll-pitch-yaw angle representation of the rotation.  The angles are
a 3-vector <span class="math notranslate nohighlight">\((r, p, y)\)</span> which correspond to successive rotations about the axes
specified by <code class="docutils literal notranslate"><span class="pre">order</span></code>:</p>
<blockquote>
<div><ul class="simple">
<li><p>‘zyx’ [default], rotate by yaw about the z-axis, then by pitch about the new y-axis,
then by roll about the new x-axis.  Convention for a mobile robot with x-axis forward
and y-axis sideways.</p></li>
<li><p>‘xyz’, rotate by yaw about the x-axis, then by pitch about the new y-axis,
then by roll about the new z-axis. Covention for a robot gripper with z-axis forward
and y-axis between the gripper fingers.</p></li>
<li><p>‘yxz’, rotate by yaw about the y-axis, then by pitch about the new x-axis,
then by roll about the new z-axis. Convention for a camera with z-axis parallel
to the optic axis and x-axis parallel to the pixel rows.</p></li>
</ul>
</div></blockquote>
<p>If <cite>len(x)</cite> is:</p>
<ul class="simple">
<li><p>1, return an ndarray with shape=(3,)</p></li>
<li><p>N&gt;1, return ndarray with shape=(N,3)</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.pose3d.SE3.RPY" title="spatialmath.pose3d.SE3.RPY"><code class="xref py py-func docutils literal notranslate"><span class="pre">RPY()</span></code></a>, :<a class="reference internal" href="#spatialmath.base.transforms3d.tr2rpy" title="spatialmath.base.transforms3d.tr2rpy"><code class="xref py py-func docutils literal notranslate"><span class="pre">spatialmath.base.transforms3d.tr2rpy()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.pose3d.SE3.shape">
<em class="property">property </em><code class="sig-name descname">shape</code><a class="headerlink" href="#spatialmath.pose3d.SE3.shape" title="Permalink to this definition">¶</a></dt>
<dd><p>Shape of the object’s matrix representation (superclass property)</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>matrix shape</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>2-tuple of ints</p>
</dd>
</dl>
<p>(2,2) for <code class="docutils literal notranslate"><span class="pre">SO2</span></code>, (3,3) for <code class="docutils literal notranslate"><span class="pre">SE2</span></code> and <code class="docutils literal notranslate"><span class="pre">SO3</span></code>, and (4,4) for <code class="docutils literal notranslate"><span class="pre">SE3</span></code>.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">SE3</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="o">.</span><span class="n">shape</span>
<span class="go">(4, 4)</span>
</pre></div>
</div>
</dd></dl>

</dd></dl>

<span class="target" id="module-spatialmath.quaternion"></span><dl class="class">
<dt id="spatialmath.quaternion.Quaternion">
<em class="property">class </em><code class="sig-prename descclassname">spatialmath.quaternion.</code><code class="sig-name descname">Quaternion</code><span class="sig-paren">(</span><em class="sig-param">s=None</em>, <em class="sig-param">v=None</em>, <em class="sig-param">check=True</em>, <em class="sig-param">norm=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/quaternion.html#Quaternion"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.quaternion.Quaternion" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">collections.UserList</span></code></p>
<p>A quaternion is a compact method of representing a 3D rotation that has
computational advantages including speed and numerical robustness.</p>
<dl class="simple">
<dt>A quaternion has 2 parts, a scalar s, and a 3-vector v and is typically written:</dt><dd><p>q = s &lt;vx vy vz&gt;</p>
</dd>
</dl>
<dl class="method">
<dt id="spatialmath.quaternion.Quaternion.__init__">
<code class="sig-name descname">__init__</code><span class="sig-paren">(</span><em class="sig-param">s=None</em>, <em class="sig-param">v=None</em>, <em class="sig-param">check=True</em>, <em class="sig-param">norm=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/quaternion.html#Quaternion.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.quaternion.Quaternion.__init__" title="Permalink to this definition">¶</a></dt>
<dd><p>A zero quaternion is one for which M{s^2+vx^2+vy^2+vz^2 = 1}.
A quaternion can be considered as a rotation about a vector in space where
q = cos (theta/2) sin(theta/2) &lt;vx vy vz&gt;
where &lt;vx vy vz&gt; is a unit vector.
:param s: scalar
:param v: vector</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.Quaternion.append">
<code class="sig-name descname">append</code><span class="sig-paren">(</span><em class="sig-param">x</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/quaternion.html#Quaternion.append"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.quaternion.Quaternion.append" title="Permalink to this definition">¶</a></dt>
<dd><p>S.append(value) – append value to the end of the sequence</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.Quaternion.s">
<em class="property">property </em><code class="sig-name descname">s</code><a class="headerlink" href="#spatialmath.quaternion.Quaternion.s" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>q</strong> (<a class="reference internal" href="#spatialmath.quaternion.Quaternion" title="spatialmath.quaternion.Quaternion"><em>Quaternion</em></a><em>, </em><a class="reference internal" href="#spatialmath.quaternion.UnitQuaternion" title="spatialmath.quaternion.UnitQuaternion"><em>UnitQuaternion</em></a>) – input quaternion</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>real part of quaternion</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>float or numpy.ndarray</p>
</dd>
</dl>
<ul class="simple">
<li><p>If the quaternion is of length one, a scalar float is returned.</p></li>
<li><p>If the quaternion is of length &gt;1, a numpy array shape=(N,) is returned.</p></li>
</ul>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.Quaternion.v">
<em class="property">property </em><code class="sig-name descname">v</code><a class="headerlink" href="#spatialmath.quaternion.Quaternion.v" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>q</strong> (<a class="reference internal" href="#spatialmath.quaternion.Quaternion" title="spatialmath.quaternion.Quaternion"><em>Quaternion</em></a><em>, </em><a class="reference internal" href="#spatialmath.quaternion.UnitQuaternion" title="spatialmath.quaternion.UnitQuaternion"><em>UnitQuaternion</em></a>) – input quaternion</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>vector part of quaternion</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy ndarray</p>
</dd>
</dl>
<ul class="simple">
<li><p>If the quaternion is of length one, a numpy array shape=(3,) is returned.</p></li>
<li><p>If the quaternion is of length &gt;1, a numpy array shape=(N,3) is returned.</p></li>
</ul>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.Quaternion.vec">
<em class="property">property </em><code class="sig-name descname">vec</code><a class="headerlink" href="#spatialmath.quaternion.Quaternion.vec" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>q</strong> (<a class="reference internal" href="#spatialmath.quaternion.Quaternion" title="spatialmath.quaternion.Quaternion"><em>Quaternion</em></a><em>, </em><a class="reference internal" href="#spatialmath.quaternion.UnitQuaternion" title="spatialmath.quaternion.UnitQuaternion"><em>UnitQuaternion</em></a>) – input quaternion</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>quaternion expressed as a vector</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy ndarray</p>
</dd>
</dl>
<ul class="simple">
<li><p>If the quaternion is of length one, a numpy array shape=(4,) is returned.</p></li>
<li><p>If the quaternion is of length &gt;1, a numpy array shape=(N,4) is returned.</p></li>
</ul>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.Quaternion.pure">
<em class="property">classmethod </em><code class="sig-name descname">pure</code><span class="sig-paren">(</span><em class="sig-param">v</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/quaternion.html#Quaternion.pure"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.quaternion.Quaternion.pure" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.Quaternion.conj">
<em class="property">property </em><code class="sig-name descname">conj</code><a class="headerlink" href="#spatialmath.quaternion.Quaternion.conj" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.Quaternion.norm">
<em class="property">property </em><code class="sig-name descname">norm</code><a class="headerlink" href="#spatialmath.quaternion.Quaternion.norm" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the norm of this quaternion.
Code retrieved from: <a class="reference external" href="https://github.com/petercorke/robotics-toolbox-python/blob/master/robot/Quaternion.py">https://github.com/petercorke/robotics-toolbox-python/blob/master/robot/Quaternion.py</a>
Original authors: Luis Fernando Lara Tobar and Peter Corke
&#64;rtype: number
&#64;return: the norm</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.Quaternion.unit">
<em class="property">property </em><code class="sig-name descname">unit</code><a class="headerlink" href="#spatialmath.quaternion.Quaternion.unit" title="Permalink to this definition">¶</a></dt>
<dd><p>Return an equivalent unit quaternion
Code retrieved from: <a class="reference external" href="https://github.com/petercorke/robotics-toolbox-python/blob/master/robot/Quaternion.py">https://github.com/petercorke/robotics-toolbox-python/blob/master/robot/Quaternion.py</a>
Original authors: Luis Fernando Lara Tobar and Peter Corke
&#64;rtype: quaternion
&#64;return: equivalent unit quaternion</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.Quaternion.matrix">
<em class="property">property </em><code class="sig-name descname">matrix</code><a class="headerlink" href="#spatialmath.quaternion.Quaternion.matrix" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.Quaternion.inner">
<code class="sig-name descname">inner</code><span class="sig-paren">(</span><em class="sig-param">other</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/quaternion.html#Quaternion.inner"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.quaternion.Quaternion.inner" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.Quaternion.__eq__">
<code class="sig-name descname">__eq__</code><span class="sig-paren">(</span><em class="sig-param">other</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/quaternion.html#Quaternion.__eq__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.quaternion.Quaternion.__eq__" title="Permalink to this definition">¶</a></dt>
<dd><p>Return self==value.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.Quaternion.__ne__">
<code class="sig-name descname">__ne__</code><span class="sig-paren">(</span><em class="sig-param">other</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/quaternion.html#Quaternion.__ne__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.quaternion.Quaternion.__ne__" title="Permalink to this definition">¶</a></dt>
<dd><p>Return self!=value.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.Quaternion.__mul__">
<code class="sig-name descname">__mul__</code><span class="sig-paren">(</span><em class="sig-param">right</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/quaternion.html#Quaternion.__mul__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.quaternion.Quaternion.__mul__" title="Permalink to this definition">¶</a></dt>
<dd><p>multiply quaternion</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>left</strong> (<a class="reference internal" href="#spatialmath.quaternion.Quaternion" title="spatialmath.quaternion.Quaternion"><em>Quaternion</em></a><em>, </em><a class="reference internal" href="#spatialmath.quaternion.UnitQuaternion" title="spatialmath.quaternion.UnitQuaternion"><em>UnitQuaternion</em></a><em>, </em><em>float</em>) – left multiplicand</p></li>
<li><p><strong>right</strong> – right multiplicand</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>product</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.quaternion.Quaternion" title="spatialmath.quaternion.Quaternion">Quaternion</a></p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>ValueError</p>
</dd>
</dl>
<table class="docutils align-default">
<colgroup>
<col style="width: 24%" />
<col style="width: 24%" />
<col style="width: 24%" />
<col style="width: 28%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head" colspan="2"><p>Multiplicands</p></th>
<th class="head" colspan="2"><p>Product</p></th>
</tr>
<tr class="row-even"><th class="head"><p>left</p></th>
<th class="head"><p>right</p></th>
<th class="head"><p>type</p></th>
<th class="head"><p>result</p></th>
</tr>
</thead>
<tbody>
<tr class="row-odd"><td><p>Quaternion</p></td>
<td><p>Quaternion</p></td>
<td><p>Quaternion</p></td>
<td><p>Hamilton product</p></td>
</tr>
<tr class="row-even"><td><p>Quaternion</p></td>
<td><p>UnitQuaternion</p></td>
<td><p>Quaternion</p></td>
<td><p>Hamilton product</p></td>
</tr>
<tr class="row-odd"><td><p>Quaternion</p></td>
<td><p>scalar</p></td>
<td><p>Quaternion</p></td>
<td><p>scalar product</p></td>
</tr>
</tbody>
</table>
<p>Any other input combinations result in a ValueError.</p>
<p>Note that left and right can have a length greater than 1 in which case:</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 9%" />
<col style="width: 11%" />
<col style="width: 9%" />
<col style="width: 71%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>left</p></th>
<th class="head"><p>right</p></th>
<th class="head"><p>len</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">*</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>N</p></td>
<td><p>N</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">*</span> <span class="pre">right[i]</span></code></p></td>
</tr>
<tr class="row-even"><td><p>N</p></td>
<td><p>1</p></td>
<td><p>N</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">*</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>N</p></td>
<td><p>N</p></td>
<td><p>N</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">*</span> <span class="pre">right[i]</span></code></p></td>
</tr>
<tr class="row-even"><td><p>N</p></td>
<td><p>M</p></td>
<td><ul class="simple">
<li></li>
</ul>
</td>
<td><p><code class="docutils literal notranslate"><span class="pre">ValueError</span></code></p></td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.Quaternion.__pow__">
<code class="sig-name descname">__pow__</code><span class="sig-paren">(</span><em class="sig-param">n</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/quaternion.html#Quaternion.__pow__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.quaternion.Quaternion.__pow__" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.Quaternion.__truediv__">
<code class="sig-name descname">__truediv__</code><span class="sig-paren">(</span><em class="sig-param">other</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/quaternion.html#Quaternion.__truediv__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.quaternion.Quaternion.__truediv__" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.Quaternion.__add__">
<code class="sig-name descname">__add__</code><span class="sig-paren">(</span><em class="sig-param">right</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/quaternion.html#Quaternion.__add__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.quaternion.Quaternion.__add__" title="Permalink to this definition">¶</a></dt>
<dd><p>add quaternions</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>left</strong> (<a class="reference internal" href="#spatialmath.quaternion.Quaternion" title="spatialmath.quaternion.Quaternion"><em>Quaternion</em></a><em>, </em><a class="reference internal" href="#spatialmath.quaternion.UnitQuaternion" title="spatialmath.quaternion.UnitQuaternion"><em>UnitQuaternion</em></a>) – left addend</p></li>
<li><p><strong>right</strong> (<a class="reference internal" href="#spatialmath.quaternion.Quaternion" title="spatialmath.quaternion.Quaternion"><em>Quaternion</em></a><em>, </em><a class="reference internal" href="#spatialmath.quaternion.UnitQuaternion" title="spatialmath.quaternion.UnitQuaternion"><em>UnitQuaternion</em></a><em>, </em><em>float</em>) – right addend</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>sum</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.quaternion.Quaternion" title="spatialmath.quaternion.Quaternion">Quaternion</a>, <a class="reference internal" href="#spatialmath.quaternion.UnitQuaternion" title="spatialmath.quaternion.UnitQuaternion">UnitQuaternion</a></p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>ValueError</p>
</dd>
</dl>
<table class="docutils align-default">
<colgroup>
<col style="width: 23%" />
<col style="width: 23%" />
<col style="width: 23%" />
<col style="width: 31%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head" colspan="2"><p>Operands</p></th>
<th class="head" colspan="2"><p>Sum</p></th>
</tr>
<tr class="row-even"><th class="head"><p>left</p></th>
<th class="head"><p>right</p></th>
<th class="head"><p>type</p></th>
<th class="head"><p>result</p></th>
</tr>
</thead>
<tbody>
<tr class="row-odd"><td><p>Quaternion</p></td>
<td><p>Quaternion</p></td>
<td><p>Quaternion</p></td>
<td><p>elementwise sum</p></td>
</tr>
<tr class="row-even"><td><p>Quaternion</p></td>
<td><p>UnitQuaternion</p></td>
<td><p>Quaternion</p></td>
<td><p>elementwise sum</p></td>
</tr>
<tr class="row-odd"><td><p>Quaternion</p></td>
<td><p>scalar</p></td>
<td><p>Quaternion</p></td>
<td><p>add to each element</p></td>
</tr>
<tr class="row-even"><td><p>UnitQuaternion</p></td>
<td><p>Quaternion</p></td>
<td><p>Quaternion</p></td>
<td><p>elementwise sum</p></td>
</tr>
<tr class="row-odd"><td><p>UnitQuaternion</p></td>
<td><p>UnitQuaternion</p></td>
<td><p>Quaternion</p></td>
<td><p>elementwise sum</p></td>
</tr>
<tr class="row-even"><td><p>UnitQuaternion</p></td>
<td><p>scalar</p></td>
<td><p>Quaternion</p></td>
<td><p>add to each element</p></td>
</tr>
</tbody>
</table>
<p>Any other input combinations result in a ValueError.</p>
<p>Note that left and right can have a length greater than 1 in which case:</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 9%" />
<col style="width: 11%" />
<col style="width: 9%" />
<col style="width: 71%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>left</p></th>
<th class="head"><p>right</p></th>
<th class="head"><p>len</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">+</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>N</p></td>
<td><p>N</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">+</span> <span class="pre">right[i]</span></code></p></td>
</tr>
<tr class="row-even"><td><p>N</p></td>
<td><p>1</p></td>
<td><p>N</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">+</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>N</p></td>
<td><p>N</p></td>
<td><p>N</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">+</span> <span class="pre">right[i]</span></code></p></td>
</tr>
<tr class="row-even"><td><p>N</p></td>
<td><p>M</p></td>
<td><ul class="simple">
<li></li>
</ul>
</td>
<td><p><code class="docutils literal notranslate"><span class="pre">ValueError</span></code></p></td>
</tr>
</tbody>
</table>
<p>A scalar of length N is a list, tuple or numpy array.
A 3-vector of length N is a 3xN numpy array, where each column is a 3-vector.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.Quaternion.__sub__">
<code class="sig-name descname">__sub__</code><span class="sig-paren">(</span><em class="sig-param">right</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/quaternion.html#Quaternion.__sub__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.quaternion.Quaternion.__sub__" title="Permalink to this definition">¶</a></dt>
<dd><p>subtract quaternions</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>left</strong> (<a class="reference internal" href="#spatialmath.quaternion.Quaternion" title="spatialmath.quaternion.Quaternion"><em>Quaternion</em></a><em>, </em><a class="reference internal" href="#spatialmath.quaternion.UnitQuaternion" title="spatialmath.quaternion.UnitQuaternion"><em>UnitQuaternion</em></a>) – left minuend</p></li>
<li><p><strong>right</strong> (<a class="reference internal" href="#spatialmath.quaternion.Quaternion" title="spatialmath.quaternion.Quaternion"><em>Quaternion</em></a><em>, </em><a class="reference internal" href="#spatialmath.quaternion.UnitQuaternion" title="spatialmath.quaternion.UnitQuaternion"><em>UnitQuaternion</em></a><em>, </em><em>float</em>) – right subtahend</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>difference</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.quaternion.Quaternion" title="spatialmath.quaternion.Quaternion">Quaternion</a>, <a class="reference internal" href="#spatialmath.quaternion.UnitQuaternion" title="spatialmath.quaternion.UnitQuaternion">UnitQuaternion</a></p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>ValueError</p>
</dd>
</dl>
<table class="docutils align-default">
<colgroup>
<col style="width: 21%" />
<col style="width: 21%" />
<col style="width: 21%" />
<col style="width: 38%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head" colspan="2"><p>Operands</p></th>
<th class="head" colspan="2"><p>Difference</p></th>
</tr>
<tr class="row-even"><th class="head"><p>left</p></th>
<th class="head"><p>right</p></th>
<th class="head"><p>type</p></th>
<th class="head"><p>result</p></th>
</tr>
</thead>
<tbody>
<tr class="row-odd"><td><p>Quaternion</p></td>
<td><p>Quaternion</p></td>
<td><p>Quaternion</p></td>
<td><p>elementwise sum</p></td>
</tr>
<tr class="row-even"><td><p>Quaternion</p></td>
<td><p>UnitQuaternion</p></td>
<td><p>Quaternion</p></td>
<td><p>elementwise sum</p></td>
</tr>
<tr class="row-odd"><td><p>Quaternion</p></td>
<td><p>scalar</p></td>
<td><p>Quaternion</p></td>
<td><p>subtract from each element</p></td>
</tr>
<tr class="row-even"><td><p>UnitQuaternion</p></td>
<td><p>Quaternion</p></td>
<td><p>Quaternion</p></td>
<td><p>elementwise sum</p></td>
</tr>
<tr class="row-odd"><td><p>UnitQuaternion</p></td>
<td><p>UnitQuaternion</p></td>
<td><p>Quaternion</p></td>
<td><p>elementwise sum</p></td>
</tr>
<tr class="row-even"><td><p>UnitQuaternion</p></td>
<td><p>scalar</p></td>
<td><p>Quaternion</p></td>
<td><p>subtract from each element</p></td>
</tr>
</tbody>
</table>
<p>Any other input combinations result in a ValueError.</p>
<p>Note that left and right can have a length greater than 1 in which case:</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 9%" />
<col style="width: 11%" />
<col style="width: 9%" />
<col style="width: 71%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>left</p></th>
<th class="head"><p>right</p></th>
<th class="head"><p>len</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">-</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>N</p></td>
<td><p>N</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">-</span> <span class="pre">right[i]</span></code></p></td>
</tr>
<tr class="row-even"><td><p>N</p></td>
<td><p>1</p></td>
<td><p>N</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">-</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>N</p></td>
<td><p>N</p></td>
<td><p>N</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">-</span> <span class="pre">right[i]</span></code></p></td>
</tr>
<tr class="row-even"><td><p>N</p></td>
<td><p>M</p></td>
<td><ul class="simple">
<li></li>
</ul>
</td>
<td><p><code class="docutils literal notranslate"><span class="pre">ValueError</span></code></p></td>
</tr>
</tbody>
</table>
<p>A scalar of length N is a list, tuple or numpy array.
A 3-vector of length N is a 3xN numpy array, where each column is a 3-vector.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.Quaternion.clear">
<code class="sig-name descname">clear</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None -- remove all items from S<a class="headerlink" href="#spatialmath.quaternion.Quaternion.clear" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.Quaternion.extend">
<code class="sig-name descname">extend</code><span class="sig-paren">(</span><em class="sig-param">other</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.quaternion.Quaternion.extend" title="Permalink to this definition">¶</a></dt>
<dd><p>S.extend(iterable) – extend sequence by appending elements from the iterable</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.Quaternion.insert">
<code class="sig-name descname">insert</code><span class="sig-paren">(</span><em class="sig-param">i</em>, <em class="sig-param">item</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.quaternion.Quaternion.insert" title="Permalink to this definition">¶</a></dt>
<dd><p>S.insert(index, value) – insert value before index</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.Quaternion.pop">
<code class="sig-name descname">pop</code><span class="sig-paren">(</span><span class="optional">[</span><em class="sig-param">index</em><span class="optional">]</span><span class="sig-paren">)</span> &#x2192; item -- remove and return item at index (default last).<a class="headerlink" href="#spatialmath.quaternion.Quaternion.pop" title="Permalink to this definition">¶</a></dt>
<dd><p>Raise IndexError if list is empty or index is out of range.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.Quaternion.reverse">
<code class="sig-name descname">reverse</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.quaternion.Quaternion.reverse" title="Permalink to this definition">¶</a></dt>
<dd><p>S.reverse() – reverse <em>IN PLACE</em></p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="spatialmath.quaternion.UnitQuaternion">
<em class="property">class </em><code class="sig-prename descclassname">spatialmath.quaternion.</code><code class="sig-name descname">UnitQuaternion</code><span class="sig-paren">(</span><em class="sig-param">s=None</em>, <em class="sig-param">v=None</em>, <em class="sig-param">norm=True</em>, <em class="sig-param">check=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/quaternion.html#UnitQuaternion"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#spatialmath.quaternion.Quaternion" title="spatialmath.quaternion.Quaternion"><code class="xref py py-class docutils literal notranslate"><span class="pre">spatialmath.quaternion.Quaternion</span></code></a></p>
<p>A unit-quaternion is is a quaternion with unit length, that is
<span class="math notranslate nohighlight">\(s^2+v_x^2+v_y^2+v_z^2 = 1\)</span>.</p>
<p>A unit-quaternion can be considered as a rotation <span class="math notranslate nohighlight">\(\theta\)</span> where
<span class="math notranslate nohighlight">\(q = \cos \theta/2 \sin \theta/2 &lt;v_x v_y v_z&gt;\)</span>.</p>
<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.__init__">
<code class="sig-name descname">__init__</code><span class="sig-paren">(</span><em class="sig-param">s=None</em>, <em class="sig-param">v=None</em>, <em class="sig-param">norm=True</em>, <em class="sig-param">check=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/quaternion.html#UnitQuaternion.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.__init__" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct a UnitQuaternion object</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>norm</strong> (<em>bool</em>) – explicitly normalize the quaternion [default True]</p></li>
<li><p><strong>check</strong> (<em>bool</em>) – explicitly check dimension of passed lists [default True]</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>new unit uaternion</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.quaternion.UnitQuaternion" title="spatialmath.quaternion.UnitQuaternion">UnitQuaternion</a></p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>ValueError</p>
</dd>
</dl>
<p>Single element quaternion:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">UnitQuaternion()</span></code> constructs the identity quaternion 1&lt;0,0,0&gt;</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">UnitQuaternion(s,</span> <span class="pre">v)</span></code> constructs a unit quaternion with specified
real <code class="docutils literal notranslate"><span class="pre">s</span></code> and <code class="docutils literal notranslate"><span class="pre">v</span></code> vector parts. <code class="docutils literal notranslate"><span class="pre">v</span></code> is a 3-vector given as a
list, tuple, numpy.ndarray</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">UnitQuaternion(v)</span></code> constructs a unit quaternion with specified
elements from <code class="docutils literal notranslate"><span class="pre">v</span></code> which is a 4-vector given as a list, tuple, numpy.ndarray</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">UnitQuaternion(R)</span></code> constructs a unit quaternion from an orthonormal
rotation matrix given as a 3x3 numpy.ndarray. If <code class="docutils literal notranslate"><span class="pre">check</span></code> is True
test the matrix for orthogonality.</p></li>
</ul>
<p>Multi-element quaternion:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">UnitQuaternion(V)</span></code> constructs a unit quaternion list with specified
elements from <code class="docutils literal notranslate"><span class="pre">V</span></code> which is an Nx4 numpy.ndarray, each row is a
quaternion.  If <code class="docutils literal notranslate"><span class="pre">norm</span></code> is True explicitly normalize each row.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">UnitQuaternion(L)</span></code> constructs a unit quaternion list from a list
of 4-element numpy.ndarrays.  If <code class="docutils literal notranslate"><span class="pre">check</span></code> is True test each element
of the list is a 4-vector. If <code class="docutils literal notranslate"><span class="pre">norm</span></code> is True explicitly normalize
each vector.</p></li>
</ul>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.R">
<em class="property">property </em><code class="sig-name descname">R</code><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.R" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.vec3">
<em class="property">property </em><code class="sig-name descname">vec3</code><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.vec3" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.Rx">
<em class="property">classmethod </em><code class="sig-name descname">Rx</code><span class="sig-paren">(</span><em class="sig-param">angle</em>, <em class="sig-param">unit='rad'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/quaternion.html#UnitQuaternion.Rx"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.Rx" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct a UnitQuaternion object representing rotation about X-axis</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>angle</strong> – rotation angle</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – rotation unit ‘rad’ [default] or ‘deg’</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>new unit-quaternion</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.quaternion.UnitQuaternion" title="spatialmath.quaternion.UnitQuaternion">UnitQuaternion</a></p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">UnitQuaternion(theta)</span></code> constructs a unit quaternion representing a
rotation of <cite>theta</cite> radians about the X-axis.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">UnitQuaternion(theta,</span> <span class="pre">'deg')</span></code> constructs a unit quaternion representing a
rotation of <cite>theta</cite> degrees about the X-axis.</p></li>
</ul>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.Ry">
<em class="property">classmethod </em><code class="sig-name descname">Ry</code><span class="sig-paren">(</span><em class="sig-param">angle</em>, <em class="sig-param">unit='rad'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/quaternion.html#UnitQuaternion.Ry"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.Ry" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct a UnitQuaternion object representing rotation about Y-axis</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>angle</strong> – rotation angle</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – rotation unit ‘rad’ [default] or ‘deg’</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>new unit-quaternion</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.quaternion.UnitQuaternion" title="spatialmath.quaternion.UnitQuaternion">UnitQuaternion</a></p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">UnitQuaternion(theta)</span></code> constructs a unit quaternion representing a
rotation of <cite>theta</cite> radians about the Y-axis.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">UnitQuaternion(theta,</span> <span class="pre">'deg')</span></code> constructs a unit quaternion representing a
rotation of <cite>theta</cite> degrees about the Y-axis.</p></li>
</ul>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.Rz">
<em class="property">classmethod </em><code class="sig-name descname">Rz</code><span class="sig-paren">(</span><em class="sig-param">angle</em>, <em class="sig-param">unit='rad'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/quaternion.html#UnitQuaternion.Rz"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.Rz" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct a UnitQuaternion object representing rotation about Z-axis</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>angle</strong> – rotation angle</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – rotation unit ‘rad’ [default] or ‘deg’</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>new unit-quaternion</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.quaternion.UnitQuaternion" title="spatialmath.quaternion.UnitQuaternion">UnitQuaternion</a></p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">UnitQuaternion(theta)</span></code> constructs a unit quaternion representing a
rotation of <cite>theta</cite> radians about the Z-axis.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">UnitQuaternion(theta,</span> <span class="pre">'deg')</span></code> constructs a unit quaternion representing a
rotation of <cite>theta</cite> degrees about the Z-axis.</p></li>
</ul>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.Rand">
<em class="property">classmethod </em><code class="sig-name descname">Rand</code><span class="sig-paren">(</span><em class="sig-param">N=1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/quaternion.html#UnitQuaternion.Rand"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.Rand" title="Permalink to this definition">¶</a></dt>
<dd><p>Create SO(3) with random rotation</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>N</strong> (<em>int</em>) – number of random rotations</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>3x3 rotation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>SO3 instance</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">SO3.Rand()</span></code> is a random SO(3) rotation.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">SO3.Rand(N)</span></code> is an SO3 object containing a sequence of N random
rotations.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.quaternion.UnitQuaternion.Rand" title="spatialmath.quaternion.UnitQuaternion.Rand"><code class="xref py py-func docutils literal notranslate"><span class="pre">spatialmath.quaternion.UnitQuaternion.Rand()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.Eul">
<em class="property">classmethod </em><code class="sig-name descname">Eul</code><span class="sig-paren">(</span><em class="sig-param">angles</em>, <em class="sig-param">*</em>, <em class="sig-param">unit='rad'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/quaternion.html#UnitQuaternion.Eul"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.Eul" title="Permalink to this definition">¶</a></dt>
<dd><p>Create an SO(3) rotation from Euler angles</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>angles</strong> (<em>array_like</em>) – 3-vector of Euler angles</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>3x3 rotation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>SO3 instance</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">SO3.Eul(ANGLES)</span></code> is an SO(3) rotation defined by a 3-vector of Euler angles <span class="math notranslate nohighlight">\((\phi,    heta, \psi)\)</span> which
correspond to consecutive rotations about the Z, Y, Z axes respectively.</p>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.pose3d.SE3.eul" title="spatialmath.pose3d.SE3.eul"><code class="xref py py-func docutils literal notranslate"><span class="pre">eul()</span></code></a>, <a class="reference internal" href="#spatialmath.pose3d.SE3.Eul" title="spatialmath.pose3d.SE3.Eul"><code class="xref py py-func docutils literal notranslate"><span class="pre">Eul()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms3d.eul2r" title="spatialmath.base.transforms3d.eul2r"><code class="xref py py-func docutils literal notranslate"><span class="pre">spatialmath.base.transforms3d.eul2r()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.RPY">
<em class="property">classmethod </em><code class="sig-name descname">RPY</code><span class="sig-paren">(</span><em class="sig-param">angles</em>, <em class="sig-param">*</em>, <em class="sig-param">order='zyx'</em>, <em class="sig-param">unit='rad'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/quaternion.html#UnitQuaternion.RPY"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.RPY" title="Permalink to this definition">¶</a></dt>
<dd><p>Create an SO(3) rotation from roll-pitch-yaw angles</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>angles</strong> (<em>array_like</em>) – 3-vector of roll-pitch-yaw angles</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p></li>
<li><p><strong>unit</strong> – rotation order: ‘zyx’ [default], ‘xyz’, or ‘yxz’</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>3x3 rotation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>SO3 instance</p>
</dd>
</dl>
<dl>
<dt><code class="docutils literal notranslate"><span class="pre">SO3.RPY(ANGLES)</span></code> is an SO(3) rotation defined by a 3-vector of roll, pitch, yaw angles <span class="math notranslate nohighlight">\((r, p, y)\)</span></dt><dd><p>which correspond to successive rotations about the axes specified by <code class="docutils literal notranslate"><span class="pre">order</span></code>:</p>
<blockquote>
<div><ul class="simple">
<li><p>‘zyx’ [default], rotate by yaw about the z-axis, then by pitch about the new y-axis,
then by roll about the new x-axis.  Convention for a mobile robot with x-axis forward
and y-axis sideways.</p></li>
<li><p>‘xyz’, rotate by yaw about the x-axis, then by pitch about the new y-axis,
then by roll about the new z-axis. Covention for a robot gripper with z-axis forward
and y-axis between the gripper fingers.</p></li>
<li><p>‘yxz’, rotate by yaw about the y-axis, then by pitch about the new x-axis,
then by roll about the new z-axis. Convention for a camera with z-axis parallel
to the optic axis and x-axis parallel to the pixel rows.</p></li>
</ul>
</div></blockquote>
</dd>
</dl>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.pose3d.SE3.rpy" title="spatialmath.pose3d.SE3.rpy"><code class="xref py py-func docutils literal notranslate"><span class="pre">rpy()</span></code></a>, <a class="reference internal" href="#spatialmath.pose3d.SE3.RPY" title="spatialmath.pose3d.SE3.RPY"><code class="xref py py-func docutils literal notranslate"><span class="pre">RPY()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms3d.rpy2r" title="spatialmath.base.transforms3d.rpy2r"><code class="xref py py-func docutils literal notranslate"><span class="pre">spatialmath.base.transforms3d.rpy2r()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.OA">
<em class="property">classmethod </em><code class="sig-name descname">OA</code><span class="sig-paren">(</span><em class="sig-param">o</em>, <em class="sig-param">a</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/quaternion.html#UnitQuaternion.OA"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.OA" title="Permalink to this definition">¶</a></dt>
<dd><p>Create SO(3) rotation from two vectors</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>o</strong> (<em>array_like</em>) – 3-vector parallel to Y- axis</p></li>
<li><p><strong>a</strong> – 3-vector parallel to the Z-axis</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>3x3 rotation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>SO3 instance</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">SO3.OA(O,</span> <span class="pre">A)</span></code> is an SO(3) rotation defined in terms of
vectors parallel to the Y- and Z-axes of its reference frame.  In robotics these axes are
respectively called the orientation and approach vectors defined such that
R = [N O A] and N = O x A.</p>
<p>Notes:</p>
<ul class="simple">
<li><p>The A vector is the only guaranteed to have the same direction in the resulting
rotation matrix</p></li>
<li><p>O and A do not have to be unit-length, they are normalized</p></li>
<li><p>O and A do not have to be orthogonal, so long as they are not parallel</p></li>
<li><p>The vectors O and A are parallel to the Y- and Z-axes of the equivalent coordinate frame.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.oa2r" title="spatialmath.base.transforms3d.oa2r"><code class="xref py py-func docutils literal notranslate"><span class="pre">spatialmath.base.transforms3d.oa2r()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.AngVec">
<em class="property">classmethod </em><code class="sig-name descname">AngVec</code><span class="sig-paren">(</span><em class="sig-param">theta</em>, <em class="sig-param">v</em>, <em class="sig-param">*</em>, <em class="sig-param">unit='rad'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/quaternion.html#UnitQuaternion.AngVec"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.AngVec" title="Permalink to this definition">¶</a></dt>
<dd><p>Create an SO(3) rotation matrix from rotation angle and axis</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>theta</strong> (<em>float</em>) – rotation</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p></li>
<li><p><strong>v</strong> (<em>array_like</em>) – rotation axis, 3-vector</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>3x3 rotation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>SO3 instance</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">SO3.AngVec(THETA,</span> <span class="pre">V)</span></code> is an SO(3) rotation defined by
a rotation of <code class="docutils literal notranslate"><span class="pre">THETA</span></code> about the vector <code class="docutils literal notranslate"><span class="pre">V</span></code>.</p>
<p>Notes:</p>
<ul class="simple">
<li><p>If <code class="docutils literal notranslate"><span class="pre">THETA</span> <span class="pre">==</span> <span class="pre">0</span></code> then return identity matrix.</p></li>
<li><p>If <code class="docutils literal notranslate"><span class="pre">THETA</span> <span class="pre">~=</span> <span class="pre">0</span></code> then <code class="docutils literal notranslate"><span class="pre">V</span></code> must have a finite length.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><code class="xref py py-func docutils literal notranslate"><span class="pre">angvec()</span></code>, <a class="reference internal" href="#spatialmath.base.transforms3d.angvec2r" title="spatialmath.base.transforms3d.angvec2r"><code class="xref py py-func docutils literal notranslate"><span class="pre">spatialmath.base.transforms3d.angvec2r()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.Omega">
<em class="property">classmethod </em><code class="sig-name descname">Omega</code><span class="sig-paren">(</span><em class="sig-param">w</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/quaternion.html#UnitQuaternion.Omega"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.Omega" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.Vec3">
<em class="property">classmethod </em><code class="sig-name descname">Vec3</code><span class="sig-paren">(</span><em class="sig-param">vec</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/quaternion.html#UnitQuaternion.Vec3"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.Vec3" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.inv">
<em class="property">property </em><code class="sig-name descname">inv</code><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.inv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.omega">
<em class="property">classmethod </em><code class="sig-name descname">omega</code><span class="sig-paren">(</span><em class="sig-param">w</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/quaternion.html#UnitQuaternion.omega"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.omega" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.qvmul">
<em class="property">static </em><code class="sig-name descname">qvmul</code><span class="sig-paren">(</span><em class="sig-param">qv1</em>, <em class="sig-param">qv2</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/quaternion.html#UnitQuaternion.qvmul"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.qvmul" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.__add__">
<code class="sig-name descname">__add__</code><span class="sig-paren">(</span><em class="sig-param">right</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.__add__" title="Permalink to this definition">¶</a></dt>
<dd><p>add quaternions</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>left</strong> (<a class="reference internal" href="#spatialmath.quaternion.Quaternion" title="spatialmath.quaternion.Quaternion"><em>Quaternion</em></a><em>, </em><a class="reference internal" href="#spatialmath.quaternion.UnitQuaternion" title="spatialmath.quaternion.UnitQuaternion"><em>UnitQuaternion</em></a>) – left addend</p></li>
<li><p><strong>right</strong> (<a class="reference internal" href="#spatialmath.quaternion.Quaternion" title="spatialmath.quaternion.Quaternion"><em>Quaternion</em></a><em>, </em><a class="reference internal" href="#spatialmath.quaternion.UnitQuaternion" title="spatialmath.quaternion.UnitQuaternion"><em>UnitQuaternion</em></a><em>, </em><em>float</em>) – right addend</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>sum</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.quaternion.Quaternion" title="spatialmath.quaternion.Quaternion">Quaternion</a>, <a class="reference internal" href="#spatialmath.quaternion.UnitQuaternion" title="spatialmath.quaternion.UnitQuaternion">UnitQuaternion</a></p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>ValueError</p>
</dd>
</dl>
<table class="docutils align-default">
<colgroup>
<col style="width: 23%" />
<col style="width: 23%" />
<col style="width: 23%" />
<col style="width: 31%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head" colspan="2"><p>Operands</p></th>
<th class="head" colspan="2"><p>Sum</p></th>
</tr>
<tr class="row-even"><th class="head"><p>left</p></th>
<th class="head"><p>right</p></th>
<th class="head"><p>type</p></th>
<th class="head"><p>result</p></th>
</tr>
</thead>
<tbody>
<tr class="row-odd"><td><p>Quaternion</p></td>
<td><p>Quaternion</p></td>
<td><p>Quaternion</p></td>
<td><p>elementwise sum</p></td>
</tr>
<tr class="row-even"><td><p>Quaternion</p></td>
<td><p>UnitQuaternion</p></td>
<td><p>Quaternion</p></td>
<td><p>elementwise sum</p></td>
</tr>
<tr class="row-odd"><td><p>Quaternion</p></td>
<td><p>scalar</p></td>
<td><p>Quaternion</p></td>
<td><p>add to each element</p></td>
</tr>
<tr class="row-even"><td><p>UnitQuaternion</p></td>
<td><p>Quaternion</p></td>
<td><p>Quaternion</p></td>
<td><p>elementwise sum</p></td>
</tr>
<tr class="row-odd"><td><p>UnitQuaternion</p></td>
<td><p>UnitQuaternion</p></td>
<td><p>Quaternion</p></td>
<td><p>elementwise sum</p></td>
</tr>
<tr class="row-even"><td><p>UnitQuaternion</p></td>
<td><p>scalar</p></td>
<td><p>Quaternion</p></td>
<td><p>add to each element</p></td>
</tr>
</tbody>
</table>
<p>Any other input combinations result in a ValueError.</p>
<p>Note that left and right can have a length greater than 1 in which case:</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 9%" />
<col style="width: 11%" />
<col style="width: 9%" />
<col style="width: 71%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>left</p></th>
<th class="head"><p>right</p></th>
<th class="head"><p>len</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">+</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>N</p></td>
<td><p>N</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">+</span> <span class="pre">right[i]</span></code></p></td>
</tr>
<tr class="row-even"><td><p>N</p></td>
<td><p>1</p></td>
<td><p>N</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">+</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>N</p></td>
<td><p>N</p></td>
<td><p>N</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">+</span> <span class="pre">right[i]</span></code></p></td>
</tr>
<tr class="row-even"><td><p>N</p></td>
<td><p>M</p></td>
<td><ul class="simple">
<li></li>
</ul>
</td>
<td><p><code class="docutils literal notranslate"><span class="pre">ValueError</span></code></p></td>
</tr>
</tbody>
</table>
<p>A scalar of length N is a list, tuple or numpy array.
A 3-vector of length N is a 3xN numpy array, where each column is a 3-vector.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.__sub__">
<code class="sig-name descname">__sub__</code><span class="sig-paren">(</span><em class="sig-param">right</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.__sub__" title="Permalink to this definition">¶</a></dt>
<dd><p>subtract quaternions</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>left</strong> (<a class="reference internal" href="#spatialmath.quaternion.Quaternion" title="spatialmath.quaternion.Quaternion"><em>Quaternion</em></a><em>, </em><a class="reference internal" href="#spatialmath.quaternion.UnitQuaternion" title="spatialmath.quaternion.UnitQuaternion"><em>UnitQuaternion</em></a>) – left minuend</p></li>
<li><p><strong>right</strong> (<a class="reference internal" href="#spatialmath.quaternion.Quaternion" title="spatialmath.quaternion.Quaternion"><em>Quaternion</em></a><em>, </em><a class="reference internal" href="#spatialmath.quaternion.UnitQuaternion" title="spatialmath.quaternion.UnitQuaternion"><em>UnitQuaternion</em></a><em>, </em><em>float</em>) – right subtahend</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>difference</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.quaternion.Quaternion" title="spatialmath.quaternion.Quaternion">Quaternion</a>, <a class="reference internal" href="#spatialmath.quaternion.UnitQuaternion" title="spatialmath.quaternion.UnitQuaternion">UnitQuaternion</a></p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>ValueError</p>
</dd>
</dl>
<table class="docutils align-default">
<colgroup>
<col style="width: 21%" />
<col style="width: 21%" />
<col style="width: 21%" />
<col style="width: 38%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head" colspan="2"><p>Operands</p></th>
<th class="head" colspan="2"><p>Difference</p></th>
</tr>
<tr class="row-even"><th class="head"><p>left</p></th>
<th class="head"><p>right</p></th>
<th class="head"><p>type</p></th>
<th class="head"><p>result</p></th>
</tr>
</thead>
<tbody>
<tr class="row-odd"><td><p>Quaternion</p></td>
<td><p>Quaternion</p></td>
<td><p>Quaternion</p></td>
<td><p>elementwise sum</p></td>
</tr>
<tr class="row-even"><td><p>Quaternion</p></td>
<td><p>UnitQuaternion</p></td>
<td><p>Quaternion</p></td>
<td><p>elementwise sum</p></td>
</tr>
<tr class="row-odd"><td><p>Quaternion</p></td>
<td><p>scalar</p></td>
<td><p>Quaternion</p></td>
<td><p>subtract from each element</p></td>
</tr>
<tr class="row-even"><td><p>UnitQuaternion</p></td>
<td><p>Quaternion</p></td>
<td><p>Quaternion</p></td>
<td><p>elementwise sum</p></td>
</tr>
<tr class="row-odd"><td><p>UnitQuaternion</p></td>
<td><p>UnitQuaternion</p></td>
<td><p>Quaternion</p></td>
<td><p>elementwise sum</p></td>
</tr>
<tr class="row-even"><td><p>UnitQuaternion</p></td>
<td><p>scalar</p></td>
<td><p>Quaternion</p></td>
<td><p>subtract from each element</p></td>
</tr>
</tbody>
</table>
<p>Any other input combinations result in a ValueError.</p>
<p>Note that left and right can have a length greater than 1 in which case:</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 9%" />
<col style="width: 11%" />
<col style="width: 9%" />
<col style="width: 71%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>left</p></th>
<th class="head"><p>right</p></th>
<th class="head"><p>len</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">-</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>N</p></td>
<td><p>N</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">-</span> <span class="pre">right[i]</span></code></p></td>
</tr>
<tr class="row-even"><td><p>N</p></td>
<td><p>1</p></td>
<td><p>N</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">-</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>N</p></td>
<td><p>N</p></td>
<td><p>N</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">-</span> <span class="pre">right[i]</span></code></p></td>
</tr>
<tr class="row-even"><td><p>N</p></td>
<td><p>M</p></td>
<td><ul class="simple">
<li></li>
</ul>
</td>
<td><p><code class="docutils literal notranslate"><span class="pre">ValueError</span></code></p></td>
</tr>
</tbody>
</table>
<p>A scalar of length N is a list, tuple or numpy array.
A 3-vector of length N is a 3xN numpy array, where each column is a 3-vector.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.append">
<code class="sig-name descname">append</code><span class="sig-paren">(</span><em class="sig-param">x</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.append" title="Permalink to this definition">¶</a></dt>
<dd><p>S.append(value) – append value to the end of the sequence</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.clear">
<code class="sig-name descname">clear</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None -- remove all items from S<a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.clear" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.conj">
<em class="property">property </em><code class="sig-name descname">conj</code><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.conj" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.dot">
<code class="sig-name descname">dot</code><span class="sig-paren">(</span><em class="sig-param">omega</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/quaternion.html#UnitQuaternion.dot"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.dot" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.extend">
<code class="sig-name descname">extend</code><span class="sig-paren">(</span><em class="sig-param">other</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.extend" title="Permalink to this definition">¶</a></dt>
<dd><p>S.extend(iterable) – extend sequence by appending elements from the iterable</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.inner">
<code class="sig-name descname">inner</code><span class="sig-paren">(</span><em class="sig-param">other</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.inner" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.insert">
<code class="sig-name descname">insert</code><span class="sig-paren">(</span><em class="sig-param">i</em>, <em class="sig-param">item</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.insert" title="Permalink to this definition">¶</a></dt>
<dd><p>S.insert(index, value) – insert value before index</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.matrix">
<em class="property">property </em><code class="sig-name descname">matrix</code><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.matrix" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.norm">
<em class="property">property </em><code class="sig-name descname">norm</code><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.norm" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the norm of this quaternion.
Code retrieved from: <a class="reference external" href="https://github.com/petercorke/robotics-toolbox-python/blob/master/robot/Quaternion.py">https://github.com/petercorke/robotics-toolbox-python/blob/master/robot/Quaternion.py</a>
Original authors: Luis Fernando Lara Tobar and Peter Corke
&#64;rtype: number
&#64;return: the norm</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.pop">
<code class="sig-name descname">pop</code><span class="sig-paren">(</span><span class="optional">[</span><em class="sig-param">index</em><span class="optional">]</span><span class="sig-paren">)</span> &#x2192; item -- remove and return item at index (default last).<a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.pop" title="Permalink to this definition">¶</a></dt>
<dd><p>Raise IndexError if list is empty or index is out of range.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.pure">
<em class="property">classmethod </em><code class="sig-name descname">pure</code><span class="sig-paren">(</span><em class="sig-param">v</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.pure" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.reverse">
<code class="sig-name descname">reverse</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.reverse" title="Permalink to this definition">¶</a></dt>
<dd><p>S.reverse() – reverse <em>IN PLACE</em></p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.s">
<em class="property">property </em><code class="sig-name descname">s</code><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.s" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>q</strong> (<a class="reference internal" href="#spatialmath.quaternion.Quaternion" title="spatialmath.quaternion.Quaternion"><em>Quaternion</em></a><em>, </em><a class="reference internal" href="#spatialmath.quaternion.UnitQuaternion" title="spatialmath.quaternion.UnitQuaternion"><em>UnitQuaternion</em></a>) – input quaternion</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>real part of quaternion</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>float or numpy.ndarray</p>
</dd>
</dl>
<ul class="simple">
<li><p>If the quaternion is of length one, a scalar float is returned.</p></li>
<li><p>If the quaternion is of length &gt;1, a numpy array shape=(N,) is returned.</p></li>
</ul>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.unit">
<em class="property">property </em><code class="sig-name descname">unit</code><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.unit" title="Permalink to this definition">¶</a></dt>
<dd><p>Return an equivalent unit quaternion
Code retrieved from: <a class="reference external" href="https://github.com/petercorke/robotics-toolbox-python/blob/master/robot/Quaternion.py">https://github.com/petercorke/robotics-toolbox-python/blob/master/robot/Quaternion.py</a>
Original authors: Luis Fernando Lara Tobar and Peter Corke
&#64;rtype: quaternion
&#64;return: equivalent unit quaternion</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.v">
<em class="property">property </em><code class="sig-name descname">v</code><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.v" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>q</strong> (<a class="reference internal" href="#spatialmath.quaternion.Quaternion" title="spatialmath.quaternion.Quaternion"><em>Quaternion</em></a><em>, </em><a class="reference internal" href="#spatialmath.quaternion.UnitQuaternion" title="spatialmath.quaternion.UnitQuaternion"><em>UnitQuaternion</em></a>) – input quaternion</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>vector part of quaternion</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy ndarray</p>
</dd>
</dl>
<ul class="simple">
<li><p>If the quaternion is of length one, a numpy array shape=(3,) is returned.</p></li>
<li><p>If the quaternion is of length &gt;1, a numpy array shape=(N,3) is returned.</p></li>
</ul>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.vec">
<em class="property">property </em><code class="sig-name descname">vec</code><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.vec" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>q</strong> (<a class="reference internal" href="#spatialmath.quaternion.Quaternion" title="spatialmath.quaternion.Quaternion"><em>Quaternion</em></a><em>, </em><a class="reference internal" href="#spatialmath.quaternion.UnitQuaternion" title="spatialmath.quaternion.UnitQuaternion"><em>UnitQuaternion</em></a>) – input quaternion</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>quaternion expressed as a vector</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy ndarray</p>
</dd>
</dl>
<ul class="simple">
<li><p>If the quaternion is of length one, a numpy array shape=(4,) is returned.</p></li>
<li><p>If the quaternion is of length &gt;1, a numpy array shape=(N,4) is returned.</p></li>
</ul>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.dotb">
<code class="sig-name descname">dotb</code><span class="sig-paren">(</span><em class="sig-param">omega</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/quaternion.html#UnitQuaternion.dotb"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.dotb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.__mul__">
<code class="sig-name descname">__mul__</code><span class="sig-paren">(</span><em class="sig-param">right</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/quaternion.html#UnitQuaternion.__mul__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.__mul__" title="Permalink to this definition">¶</a></dt>
<dd><p>Multiply unit quaternion</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>left</strong> (<a class="reference internal" href="#spatialmath.quaternion.UnitQuaternion" title="spatialmath.quaternion.UnitQuaternion"><em>UnitQuaternion</em></a><em>, </em><a class="reference internal" href="#spatialmath.quaternion.Quaternion" title="spatialmath.quaternion.Quaternion"><em>Quaternion</em></a><em>, </em><em>3-vector</em><em>, </em><em>3xN array</em><em>, </em><em>float</em>) – left multiplicand</p></li>
<li><p><strong>right</strong> – right multiplicand</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>product</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.quaternion.Quaternion" title="spatialmath.quaternion.Quaternion">Quaternion</a>, <a class="reference internal" href="#spatialmath.quaternion.UnitQuaternion" title="spatialmath.quaternion.UnitQuaternion">UnitQuaternion</a></p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>ValueError</p>
</dd>
</dl>
<table class="docutils align-default">
<colgroup>
<col style="width: 24%" />
<col style="width: 24%" />
<col style="width: 24%" />
<col style="width: 28%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head" colspan="2"><p>Multiplicands</p></th>
<th class="head" colspan="2"><p>Product</p></th>
</tr>
<tr class="row-even"><th class="head"><p>left</p></th>
<th class="head"><p>right</p></th>
<th class="head"><p>type</p></th>
<th class="head"><p>result</p></th>
</tr>
</thead>
<tbody>
<tr class="row-odd"><td><p>UnitQuaternion</p></td>
<td><p>Quaternion</p></td>
<td><p>Quaternion</p></td>
<td><p>Hamilton product</p></td>
</tr>
<tr class="row-even"><td><p>UnitQuaternion</p></td>
<td><p>UnitQuaternion</p></td>
<td><p>UnitQuaternion</p></td>
<td><p>Hamilton product</p></td>
</tr>
<tr class="row-odd"><td><p>UnitQuaternion</p></td>
<td><p>scalar</p></td>
<td><p>Quaternion</p></td>
<td><p>scalar product</p></td>
</tr>
<tr class="row-even"><td><p>UnitQuaternion</p></td>
<td><p>3-vector</p></td>
<td><p>3-vector</p></td>
<td><p>vector rotation</p></td>
</tr>
<tr class="row-odd"><td><p>UnitQuaternion</p></td>
<td><p>3xN array</p></td>
<td><p>3xN array</p></td>
<td><p>vector rotations</p></td>
</tr>
</tbody>
</table>
<p>Any other input combinations result in a ValueError.</p>
<p>Note that left and right can have a length greater than 1 in which case:</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 9%" />
<col style="width: 11%" />
<col style="width: 9%" />
<col style="width: 71%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>left</p></th>
<th class="head"><p>right</p></th>
<th class="head"><p>len</p></th>
<th class="head"><p>operation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>1</p></td>
<td><p>1</p></td>
<td><p>1</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">*</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>1</p></td>
<td><p>N</p></td>
<td><p>N</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left</span> <span class="pre">*</span> <span class="pre">right[i]</span></code></p></td>
</tr>
<tr class="row-even"><td><p>N</p></td>
<td><p>1</p></td>
<td><p>N</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">*</span> <span class="pre">right</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>N</p></td>
<td><p>N</p></td>
<td><p>N</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">prod[i]</span> <span class="pre">=</span> <span class="pre">left[i]</span> <span class="pre">*</span> <span class="pre">right[i]</span></code></p></td>
</tr>
<tr class="row-even"><td><p>N</p></td>
<td><p>M</p></td>
<td><ul class="simple">
<li></li>
</ul>
</td>
<td><p><code class="docutils literal notranslate"><span class="pre">ValueError</span></code></p></td>
</tr>
</tbody>
</table>
<p>A scalar of length N is a list, tuple or numpy array.
A 3-vector of length N is a 3xN numpy array, where each column is a 3-vector.</p>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><code class="xref py py-func docutils literal notranslate"><span class="pre">__mul__()</span></code></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.__truediv__">
<code class="sig-name descname">__truediv__</code><span class="sig-paren">(</span><em class="sig-param">right</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/quaternion.html#UnitQuaternion.__truediv__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.__truediv__" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.__pow__">
<code class="sig-name descname">__pow__</code><span class="sig-paren">(</span><em class="sig-param">n</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/quaternion.html#UnitQuaternion.__pow__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.__pow__" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.__eq__">
<code class="sig-name descname">__eq__</code><span class="sig-paren">(</span><em class="sig-param">right</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/quaternion.html#UnitQuaternion.__eq__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.__eq__" title="Permalink to this definition">¶</a></dt>
<dd><p>Return self==value.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.__ne__">
<code class="sig-name descname">__ne__</code><span class="sig-paren">(</span><em class="sig-param">right</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/quaternion.html#UnitQuaternion.__ne__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.__ne__" title="Permalink to this definition">¶</a></dt>
<dd><p>Return self!=value.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.interp">
<code class="sig-name descname">interp</code><span class="sig-paren">(</span><em class="sig-param">s=0</em>, <em class="sig-param">dest=None</em>, <em class="sig-param">shortest=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/quaternion.html#UnitQuaternion.interp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.interp" title="Permalink to this definition">¶</a></dt>
<dd><p>Algorithm source: <a class="reference external" href="https://en.wikipedia.org/wiki/Slerp">https://en.wikipedia.org/wiki/Slerp</a>
:param qr: UnitQuaternion
:param shortest: Take the shortest path along the great circle
:param s: interpolation in range [0,1]
:type s: float
:return: interpolated UnitQuaternion</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.plot">
<code class="sig-name descname">plot</code><span class="sig-paren">(</span><em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/quaternion.html#UnitQuaternion.plot"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.plot" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.rpy">
<em class="property">property </em><code class="sig-name descname">rpy</code><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.rpy" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.eul">
<em class="property">property </em><code class="sig-name descname">eul</code><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.eul" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.angvec">
<em class="property">property </em><code class="sig-name descname">angvec</code><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.angvec" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.SO3">
<em class="property">property </em><code class="sig-name descname">SO3</code><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.SO3" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="spatialmath.quaternion.UnitQuaternion.SE3">
<em class="property">property </em><code class="sig-name descname">SE3</code><a class="headerlink" href="#spatialmath.quaternion.UnitQuaternion.SE3" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</div>
</div>
<div class="section" id="geometry">
<h2>Geometry<a class="headerlink" href="#geometry" title="Permalink to this headline">¶</a></h2>
<div class="section" id="module-spatialmath.geom3d">
<span id="geometry-in-3d"></span><h3>Geometry in 3D<a class="headerlink" href="#module-spatialmath.geom3d" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="spatialmath.geom3d.Plane">
<em class="property">class </em><code class="sig-prename descclassname">spatialmath.geom3d.</code><code class="sig-name descname">Plane</code><span class="sig-paren">(</span><em class="sig-param">c</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/geom3d.html#Plane"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.geom3d.Plane" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Create a plane object from linear coefficients</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>c</strong> (<em>4-element array_like</em>) – Plane coefficients</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>a Plane object</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.geom3d.Plane" title="spatialmath.geom3d.Plane">Plane</a></p>
</dd>
</dl>
<p>Planes are represented by the 4-vector <span class="math notranslate nohighlight">\([a, b, c, d]\)</span> which describes
the plane <span class="math notranslate nohighlight">\(\pi: ax + by + cz + d=0\)</span>.</p>
<dl class="method">
<dt id="spatialmath.geom3d.Plane.__init__">
<code class="sig-name descname">__init__</code><span class="sig-paren">(</span><em class="sig-param">c</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/geom3d.html#Plane.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.geom3d.Plane.__init__" title="Permalink to this definition">¶</a></dt>
<dd><p>Initialize self.  See help(type(self)) for accurate signature.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plane.PN">
<em class="property">static </em><code class="sig-name descname">PN</code><span class="sig-paren">(</span><em class="sig-param">p</em>, <em class="sig-param">n</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/geom3d.html#Plane.PN"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.geom3d.Plane.PN" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a plane object from point and normal</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>p</strong> (<em>3-element array_like</em>) – Point in the plane</p></li>
<li><p><strong>n</strong> (<em>3-element array_like</em>) – Normal to the plane</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>a Plane object</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.geom3d.Plane" title="spatialmath.geom3d.Plane">Plane</a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plane.P3">
<em class="property">static </em><code class="sig-name descname">P3</code><span class="sig-paren">(</span><em class="sig-param">p</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/geom3d.html#Plane.P3"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.geom3d.Plane.P3" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a plane object from three points</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>p</strong> (<em>numpy.ndarray</em><em>, </em><em>shape=</em><em>(</em><em>3</em><em>,</em><em>3</em><em>)</em>) – Three points in the plane</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>a Plane object</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.geom3d.Plane" title="spatialmath.geom3d.Plane">Plane</a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plane.n">
<em class="property">property </em><code class="sig-name descname">n</code><a class="headerlink" href="#spatialmath.geom3d.Plane.n" title="Permalink to this definition">¶</a></dt>
<dd><p>Normal to the plane</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>Normal to the plane</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>3-element array_like</p>
</dd>
</dl>
<p>For a plane <span class="math notranslate nohighlight">\(\pi: ax + by + cz + d=0\)</span> this is the vector
<span class="math notranslate nohighlight">\([a,b,c]\)</span>.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plane.d">
<em class="property">property </em><code class="sig-name descname">d</code><a class="headerlink" href="#spatialmath.geom3d.Plane.d" title="Permalink to this definition">¶</a></dt>
<dd><p>Plane offset</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>Offset of the plane</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>float</p>
</dd>
</dl>
<p>For a plane <span class="math notranslate nohighlight">\(\pi: ax + by + cz + d=0\)</span> this is the scalar
<span class="math notranslate nohighlight">\(d\)</span>.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plane.contains">
<code class="sig-name descname">contains</code><span class="sig-paren">(</span><em class="sig-param">p</em>, <em class="sig-param">tol=2.220446049250313e-15</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/geom3d.html#Plane.contains"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.geom3d.Plane.contains" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>p</strong> (<em>3-element array_like</em>) – A 3D point</p></li>
<li><p><strong>tol</strong> (<em>float</em><em>, </em><em>optional</em>) – Tolerance, defaults to 10*_eps</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>if the point is in the plane</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plane.__eq__">
<code class="sig-name descname">__eq__</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.geom3d.Plane.__eq__" title="Permalink to this definition">¶</a></dt>
<dd><p>Return self==value.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plane.__ne__">
<code class="sig-name descname">__ne__</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.geom3d.Plane.__ne__" title="Permalink to this definition">¶</a></dt>
<dd><p>Return self!=value.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="spatialmath.geom3d.Plucker">
<em class="property">class </em><code class="sig-prename descclassname">spatialmath.geom3d.</code><code class="sig-name descname">Plucker</code><span class="sig-paren">(</span><em class="sig-param">v=None</em>, <em class="sig-param">w=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/geom3d.html#Plucker"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.geom3d.Plucker" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">collections.UserList</span></code></p>
<p>Plucker coordinate class</p>
<p>Concrete class to represent a 3D line using Plucker coordinates.</p>
<p>Methods:</p>
<p>Plucker            Contructor from points
Plucker.planes     Constructor from planes
Plucker.pointdir   Constructor from point and direction</p>
<p>Information and test methods::
closest            closest point on line
commonperp         common perpendicular for two lines
contains           test if point is on line
distance           minimum distance between two lines
intersects         intersection point for two lines
intersect_plane    intersection points with a plane
intersect_volume   intersection points with a volume
pp                 principal point
ppd                principal point distance from origin
point              generate point on line</p>
<p>Conversion methods::
char               convert to human readable string
double             convert to 6-vector
skew               convert to 4x4 skew symmetric matrix</p>
<p>Display and print methods::
display            display in human readable form
plot               plot line</p>
<p>Operators:
*                  multiply Plucker matrix by a general matrix
|                  test if lines are parallel
^                  test if lines intersect
==                 test if two lines are equivalent
~=                 test if lines are not equivalent</p>
<p>Notes:</p>
<blockquote>
<div><ul class="simple">
<li><p>This is reference (handle) class object</p></li>
<li><p>Plucker objects can be used in vectors and arrays</p></li>
</ul>
</div></blockquote>
<p>References:</p>
<blockquote>
<div><ul class="simple">
<li><p>Ken Shoemake, “Ray Tracing News”, Volume 11, Number 1
<a class="reference external" href="http://www.realtimerendering.com/resources/RTNews/html/rtnv11n1.html#art3">http://www.realtimerendering.com/resources/RTNews/html/rtnv11n1.html#art3</a></p></li>
<li><p>Matt Mason lecture notes <a class="reference external" href="http://www.cs.cmu.edu/afs/cs/academic/class/16741-s07/www/lectures/lecture9.pdf">http://www.cs.cmu.edu/afs/cs/academic/class/16741-s07/www/lectures/lecture9.pdf</a></p></li>
<li><p>Robotics, Vision &amp; Control: Second Edition, P. Corke, Springer 2016; p596-7.</p></li>
</ul>
</div></blockquote>
<p>Implementation notes:</p>
<blockquote>
<div><ul class="simple">
<li><p>The internal representation is a 6-vector [v, w] where v (moment), w (direction).</p></li>
<li><p>There is a huge variety of notation used across the literature, as well as the ordering
of the direction and moment components in the 6-vector.</p></li>
</ul>
</div></blockquote>
<p>Copyright (C) 1993-2019 Peter I. Corke</p>
<dl class="method">
<dt id="spatialmath.geom3d.Plucker.__init__">
<code class="sig-name descname">__init__</code><span class="sig-paren">(</span><em class="sig-param">v=None</em>, <em class="sig-param">w=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/geom3d.html#Plucker.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.geom3d.Plucker.__init__" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a Plucker 3D line object</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>v</strong> (<em>6-element array_like</em><em>, </em><em>Plucker instance</em><em>, </em><em>3-element array_like</em>) – Plucker vector, Plucker object, Plucker moment</p></li>
<li><p><strong>w</strong> (<em>3-element array_like</em><em>, </em><em>optional</em>) – Plucker direction, optional</p></li>
</ul>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>ValueError</strong> – bad arguments</p>
</dd>
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>Plucker line</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference internal" href="#spatialmath.geom3d.Plucker" title="spatialmath.geom3d.Plucker">Plucker</a></p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">L</span> <span class="pre">=</span> <span class="pre">Plucker(X)</span></code> creates a Plucker object from the Plucker coordinate vector
<code class="docutils literal notranslate"><span class="pre">X</span></code> = [V,W] where V (3-vector) is the moment and W (3-vector) is the line direction.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">L</span> <span class="pre">=</span> <span class="pre">Plucker(L)</span></code> creates a copy of the Plucker object <code class="docutils literal notranslate"><span class="pre">L</span></code>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">L</span> <span class="pre">=</span> <span class="pre">Plucker(V,</span> <span class="pre">W)</span></code> creates a Plucker object from moment <code class="docutils literal notranslate"><span class="pre">V</span></code> (3-vector) and
line direction <code class="docutils literal notranslate"><span class="pre">W</span></code> (3-vector).</p></li>
</ul>
<p>Notes:</p>
<ul class="simple">
<li><p>The Plucker object inherits from <code class="docutils literal notranslate"><span class="pre">collections.UserList</span></code> and has list-like
behaviours.</p></li>
<li><p>A single Plucker object contains a 1D array of Plucker coordinates.</p></li>
<li><p>The elements of the array are guaranteed to be Plucker coordinates.</p></li>
<li><p>The number of elements is given by <code class="docutils literal notranslate"><span class="pre">len(L)</span></code></p></li>
<li><p>The elements can be accessed using index and slice notation, eg. <code class="docutils literal notranslate"><span class="pre">L[1]</span></code> or
<code class="docutils literal notranslate"><span class="pre">L[2:3]</span></code></p></li>
<li><p>The Plucker instance can be used as an iterator in a for loop or list comprehension.</p></li>
<li><p>Some methods support operations on the internal list.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>Plucker.PQ, Plucker.Planes, Plucker.PointDir</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.PQ">
<em class="property">static </em><code class="sig-name descname">PQ</code><span class="sig-paren">(</span><em class="sig-param">P=None</em>, <em class="sig-param">Q=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/geom3d.html#Plucker.PQ"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.geom3d.Plucker.PQ" title="Permalink to this definition">¶</a></dt>
<dd><p>Create Plucker line object from two 3D points</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>P</strong> (<em>3-element array_like</em>) – First 3D point</p></li>
<li><p><strong>Q</strong> (<em>3-element array_like</em>) – Second 3D point</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Plucker line</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.geom3d.Plucker" title="spatialmath.geom3d.Plucker">Plucker</a></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">L</span> <span class="pre">=</span> <span class="pre">Plucker(P,</span> <span class="pre">Q)</span></code> create a Plucker object that represents
the line joining the 3D points <code class="docutils literal notranslate"><span class="pre">P</span></code> (3-vector) and <code class="docutils literal notranslate"><span class="pre">Q</span></code> (3-vector). The direction
is from <code class="docutils literal notranslate"><span class="pre">Q</span></code> to <code class="docutils literal notranslate"><span class="pre">P</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>Plucker, Plucker.Planes, Plucker.PointDir</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.Planes">
<em class="property">static </em><code class="sig-name descname">Planes</code><span class="sig-paren">(</span><em class="sig-param">pi1</em>, <em class="sig-param">pi2</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/geom3d.html#Plucker.Planes"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.geom3d.Plucker.Planes" title="Permalink to this definition">¶</a></dt>
<dd><p>Create Plucker line from two planes</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>pi1</strong> (<em>4-element array_like</em><em>, or </em><a class="reference internal" href="#spatialmath.geom3d.Plane" title="spatialmath.geom3d.Plane"><em>Plane</em></a>) – First plane</p></li>
<li><p><strong>pi2</strong> (<em>4-element array_like</em><em>, or </em><a class="reference internal" href="#spatialmath.geom3d.Plane" title="spatialmath.geom3d.Plane"><em>Plane</em></a>) – Second plane</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Plucker line</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.geom3d.Plucker" title="spatialmath.geom3d.Plucker">Plucker</a></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">L</span> <span class="pre">=</span> <span class="pre">Plucker.planes(PI1,</span> <span class="pre">PI2)</span></code> is a Plucker object that represents
the line formed by the intersection of two planes <code class="docutils literal notranslate"><span class="pre">PI1</span></code> and <code class="docutils literal notranslate"><span class="pre">PI2</span></code>.</p>
<p>Planes are represented by the 4-vector <span class="math notranslate nohighlight">\([a, b, c, d]\)</span> which describes
the plane <span class="math notranslate nohighlight">\(\pi: ax + by + cz + d=0\)</span>.</p>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>Plucker, Plucker.PQ, Plucker.PointDir</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.PointDir">
<em class="property">static </em><code class="sig-name descname">PointDir</code><span class="sig-paren">(</span><em class="sig-param">point</em>, <em class="sig-param">dir</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/geom3d.html#Plucker.PointDir"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.geom3d.Plucker.PointDir" title="Permalink to this definition">¶</a></dt>
<dd><p>Create Plucker line from point and direction</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>point</strong> (<em>3-element array_like</em>) – A 3D point</p></li>
<li><p><strong>dir</strong> (<em>3-element array_like</em>) – Direction vector</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Plucker line</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.geom3d.Plucker" title="spatialmath.geom3d.Plucker">Plucker</a></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">L</span> <span class="pre">=</span> <span class="pre">Plucker.pointdir(P,</span> <span class="pre">W)</span></code> is a Plucker object that represents the
line containing the point <code class="docutils literal notranslate"><span class="pre">P</span></code> and parallel to the direction vector <code class="docutils literal notranslate"><span class="pre">W</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>Plucker, Plucker.Planes, Plucker.PQ</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.append">
<code class="sig-name descname">append</code><span class="sig-paren">(</span><em class="sig-param">x</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/geom3d.html#Plucker.append"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.geom3d.Plucker.append" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>x</strong> (<a class="reference internal" href="#spatialmath.geom3d.Plucker" title="spatialmath.geom3d.Plucker"><em>Plucker</em></a>) – Plucker object</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>ValueError</strong> – Attempt to append a non Plucker object</p>
</dd>
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>Plucker object with new Plucker line appended</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference internal" href="#spatialmath.geom3d.Plucker" title="spatialmath.geom3d.Plucker">Plucker</a></p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.A">
<em class="property">property </em><code class="sig-name descname">A</code><a class="headerlink" href="#spatialmath.geom3d.Plucker.A" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.v">
<em class="property">property </em><code class="sig-name descname">v</code><a class="headerlink" href="#spatialmath.geom3d.Plucker.v" title="Permalink to this definition">¶</a></dt>
<dd><p>Moment vector</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>the moment vector</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>numpy.ndarray, shape=(3,)</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.w">
<em class="property">property </em><code class="sig-name descname">w</code><a class="headerlink" href="#spatialmath.geom3d.Plucker.w" title="Permalink to this definition">¶</a></dt>
<dd><p>Direction vector</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>the direction vector</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>numpy.ndarray, shape=(3,)</p>
</dd>
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>Plucker.uw</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.uw">
<em class="property">property </em><code class="sig-name descname">uw</code><a class="headerlink" href="#spatialmath.geom3d.Plucker.uw" title="Permalink to this definition">¶</a></dt>
<dd><p>Line direction as a unit vector</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>Line direction</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>numpy.ndarray, shape=(3,)</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">line.uw</span></code> is a unit-vector parallel to the line.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.vec">
<em class="property">property </em><code class="sig-name descname">vec</code><a class="headerlink" href="#spatialmath.geom3d.Plucker.vec" title="Permalink to this definition">¶</a></dt>
<dd><p>Line as a Plucker coordinate vector</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>Coordinate vector</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>numpy.ndarray, shape=(6,)</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">line.vec</span></code> is the  Plucker coordinate vector <code class="docutils literal notranslate"><span class="pre">X</span></code> = [V,W] where V (3-vector)
is the moment and W (3-vector) is the line direction.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.skew">
<em class="property">property </em><code class="sig-name descname">skew</code><a class="headerlink" href="#spatialmath.geom3d.Plucker.skew" title="Permalink to this definition">¶</a></dt>
<dd><p>Line as a Plucker skew-matrix</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>Skew-symmetric matrix form of Plucker coordinates</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>numpy.ndarray, shape=(4,4)</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">M</span> <span class="pre">=</span> <span class="pre">line.skew()</span></code> is the Plucker matrix, a 4x4 skew-symmetric matrix
representation of the line.</p>
<p>Notes:</p>
<blockquote>
<div><ul class="simple">
<li><p>For two homogeneous points P and Q on the line, <span class="math notranslate nohighlight">\(PQ^T-QP^T\)</span> is also skew
symmetric.</p></li>
<li><p>The projection of Plucker line by a perspective camera is a homogeneous line (3x1)
given by <span class="math notranslate nohighlight">\(\vee C M C^T\)</span> where <span class="math notranslate nohighlight">\(C \in \mathbf{R}^{3 \times 4}\)</span> is the camera matrix.</p></li>
</ul>
</div></blockquote>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.pp">
<em class="property">property </em><code class="sig-name descname">pp</code><a class="headerlink" href="#spatialmath.geom3d.Plucker.pp" title="Permalink to this definition">¶</a></dt>
<dd><p>Principal point of the line</p>
<p><code class="docutils literal notranslate"><span class="pre">line.pp</span></code> is the point on the line that is closest to the origin.</p>
<p>Notes:</p>
<blockquote>
<div><ul class="simple">
<li><p>Same as Plucker.point(0)</p></li>
</ul>
</div></blockquote>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>Plucker.ppd, Plucker.point</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.ppd">
<em class="property">property </em><code class="sig-name descname">ppd</code><a class="headerlink" href="#spatialmath.geom3d.Plucker.ppd" title="Permalink to this definition">¶</a></dt>
<dd><p>Distance from principal point to the origin</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>Distance from principal point to the origin</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>float</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">line.ppd</span></code> is the distance from the principal point to the origin.
This is the smallest distance of any point on the line
to the origin.</p>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>Plucker.pp</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.point">
<code class="sig-name descname">point</code><span class="sig-paren">(</span><em class="sig-param">lam</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/geom3d.html#Plucker.point"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.geom3d.Plucker.point" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate point on line</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>lam</strong> (<em>float</em>) – Scalar distance from principal point</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Distance from principal point to the origin</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>float</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">line.point(LAMBDA)</span></code> is a point on the line, where <code class="docutils literal notranslate"><span class="pre">LAMBDA</span></code> is the parametric
distance along the line from the principal point of the line such
that <span class="math notranslate nohighlight">\(P = P_p + \lambda \hat{d}\)</span> and <span class="math notranslate nohighlight">\(\hat{d}\)</span> is the line
direction given by <code class="docutils literal notranslate"><span class="pre">line.uw</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>Plucker.pp, Plucker.closest, Plucker.uw</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.contains">
<code class="sig-name descname">contains</code><span class="sig-paren">(</span><em class="sig-param">x</em>, <em class="sig-param">tol=1.1102230246251565e-14</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/geom3d.html#Plucker.contains"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.geom3d.Plucker.contains" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if points are on the line</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<em>3-element array_like</em><em>, or </em><em>numpy.ndarray</em><em>, </em><em>shape=</em><em>(</em><em>3</em><em>,</em><em>N</em><em>)</em>) – 3D point</p></li>
<li><p><strong>tol</strong> (<em>float</em><em>, </em><em>optional</em>) – Tolerance, defaults to 50*_eps</p></li>
</ul>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>ValueError</strong> – Bad argument</p>
</dd>
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>Whether point is on the line</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>bool or numpy.ndarray(N) of bool</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">line.contains(X)</span></code> is true if the point <code class="docutils literal notranslate"><span class="pre">X</span></code> lies on the line defined by
the Plucker object self.</p>
<p>If <code class="docutils literal notranslate"><span class="pre">X</span></code> is an array with 3 rows, the test is performed on every column and
an array of booleans is returned.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.__eq__">
<code class="sig-name descname">__eq__</code><span class="sig-paren">(</span><em class="sig-param">l2</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/geom3d.html#Plucker.__eq__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.geom3d.Plucker.__eq__" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if two lines are equivalent</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>l1</strong> (<a class="reference internal" href="#spatialmath.geom3d.Plucker" title="spatialmath.geom3d.Plucker"><em>Plucker</em></a>) – First line</p></li>
<li><p><strong>l2</strong> (<a class="reference internal" href="#spatialmath.geom3d.Plucker" title="spatialmath.geom3d.Plucker"><em>Plucker</em></a>) – Second line</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Plucker</p>
</dd>
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>line equivalence</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>bool</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">L1</span> <span class="pre">==</span> <span class="pre">L2</span></code> is true if the Plucker objects describe the same line in
space.  Note that because of the over parameterization, lines can be
equivalent even if their coordinate vectors are different.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.__ne__">
<code class="sig-name descname">__ne__</code><span class="sig-paren">(</span><em class="sig-param">l2</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/geom3d.html#Plucker.__ne__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.geom3d.Plucker.__ne__" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if two lines are not equivalent</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>l1</strong> (<a class="reference internal" href="#spatialmath.geom3d.Plucker" title="spatialmath.geom3d.Plucker"><em>Plucker</em></a>) – First line</p></li>
<li><p><strong>l2</strong> (<a class="reference internal" href="#spatialmath.geom3d.Plucker" title="spatialmath.geom3d.Plucker"><em>Plucker</em></a>) – Second line</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>line inequivalence</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">L1</span> <span class="pre">!=</span> <span class="pre">L2</span></code> is true if the Plucker objects describe different lines in
space.  Note that because of the over parameterization, lines can be
equivalent even if their coordinate vectors are different.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.isparallel">
<code class="sig-name descname">isparallel</code><span class="sig-paren">(</span><em class="sig-param">l2</em>, <em class="sig-param">tol=2.220446049250313e-15</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/geom3d.html#Plucker.isparallel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.geom3d.Plucker.isparallel" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if lines are parallel</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>l1</strong> (<a class="reference internal" href="#spatialmath.geom3d.Plucker" title="spatialmath.geom3d.Plucker"><em>Plucker</em></a>) – First line</p></li>
<li><p><strong>l2</strong> (<a class="reference internal" href="#spatialmath.geom3d.Plucker" title="spatialmath.geom3d.Plucker"><em>Plucker</em></a>) – Second line</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>lines are parallel</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">l1.isparallel(l2)</span></code> is true if the two lines are parallel.</p>
<p><code class="docutils literal notranslate"><span class="pre">l1</span> <span class="pre">|</span> <span class="pre">l2</span></code> as above but in binary operator form</p>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>Plucker.or, Plucker.intersects</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.__or__">
<code class="sig-name descname">__or__</code><span class="sig-paren">(</span><em class="sig-param">l2</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/geom3d.html#Plucker.__or__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.geom3d.Plucker.__or__" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if lines are parallel as a binary operator</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>l1</strong> (<a class="reference internal" href="#spatialmath.geom3d.Plucker" title="spatialmath.geom3d.Plucker"><em>Plucker</em></a>) – First line</p></li>
<li><p><strong>l2</strong> (<a class="reference internal" href="#spatialmath.geom3d.Plucker" title="spatialmath.geom3d.Plucker"><em>Plucker</em></a>) – Second line</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>lines are parallel</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">l1</span> <span class="pre">|</span> <span class="pre">l2</span></code> is an operator which is true if the two lines are parallel.</p>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>Plucker.isparallel, Plucker.__xor__</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.__xor__">
<code class="sig-name descname">__xor__</code><span class="sig-paren">(</span><em class="sig-param">l2</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/geom3d.html#Plucker.__xor__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.geom3d.Plucker.__xor__" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if lines intersect as a binary operator</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>l1</strong> (<a class="reference internal" href="#spatialmath.geom3d.Plucker" title="spatialmath.geom3d.Plucker"><em>Plucker</em></a>) – First line</p></li>
<li><p><strong>l2</strong> (<a class="reference internal" href="#spatialmath.geom3d.Plucker" title="spatialmath.geom3d.Plucker"><em>Plucker</em></a>) – Second line</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>lines intersect</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">l1</span> <span class="pre">^</span> <span class="pre">l2</span></code> is an operator which is true if the two lines intersect at a point.</p>
<p>Notes:</p>
<blockquote>
<div><ul class="simple">
<li><p>Is false if the lines are equivalent since they would intersect at
an infinite number of points.</p></li>
</ul>
</div></blockquote>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>Plucker.intersects, Plucker.parallel</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.intersects">
<code class="sig-name descname">intersects</code><span class="sig-paren">(</span><em class="sig-param">l2</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/geom3d.html#Plucker.intersects"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.geom3d.Plucker.intersects" title="Permalink to this definition">¶</a></dt>
<dd><p>Intersection point of two lines</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>l1</strong> (<a class="reference internal" href="#spatialmath.geom3d.Plucker" title="spatialmath.geom3d.Plucker"><em>Plucker</em></a>) – First line</p></li>
<li><p><strong>l2</strong> (<a class="reference internal" href="#spatialmath.geom3d.Plucker" title="spatialmath.geom3d.Plucker"><em>Plucker</em></a>) – Second line</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>3D intersection point</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(3,) or None</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">l1.intersects(l2)</span></code> is the point of intersection of the two lines, or
<code class="docutils literal notranslate"><span class="pre">None</span></code> if the lines do not intersect or are equivalent.</p>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>Plucker.commonperp, Plucker.eq, Plucker.__xor__</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.distance">
<code class="sig-name descname">distance</code><span class="sig-paren">(</span><em class="sig-param">l2</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/geom3d.html#Plucker.distance"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.geom3d.Plucker.distance" title="Permalink to this definition">¶</a></dt>
<dd><p>Minimum distance between lines</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>l1</strong> (<a class="reference internal" href="#spatialmath.geom3d.Plucker" title="spatialmath.geom3d.Plucker"><em>Plucker</em></a>) – First line</p></li>
<li><p><strong>l2</strong> (<a class="reference internal" href="#spatialmath.geom3d.Plucker" title="spatialmath.geom3d.Plucker"><em>Plucker</em></a>) – Second line</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Closest distance</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>float</p>
</dd>
</dl>
<p><a href="#id5"><span class="problematic" id="id6">``</span></a>l1.distance(l2) is the minimum distance between two lines.</p>
<p>Notes:</p>
<blockquote>
<div><ul class="simple">
<li><p>Works for parallel, skew and intersecting lines.</p></li>
</ul>
</div></blockquote>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.closest">
<code class="sig-name descname">closest</code><span class="sig-paren">(</span><em class="sig-param">x</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/geom3d.html#Plucker.closest"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.geom3d.Plucker.closest" title="Permalink to this definition">¶</a></dt>
<dd><p>Point on line closest to given point</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>line</strong> – A line</p></li>
<li><p><strong>l2</strong> (<em>3-element array_like</em>) – An arbitrary 3D point</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Point on the line and distance to line</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>collections.namedtuple</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">line.closest(x).p</span></code> is the coordinate of a point on the line that is
closest to <code class="docutils literal notranslate"><span class="pre">x</span></code>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">line.closest(x).d</span></code> is the distance between the point on the line and <code class="docutils literal notranslate"><span class="pre">x</span></code>.</p></li>
</ul>
<p>The return value is a named tuple with elements:</p>
<blockquote>
<div><ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">.p</span></code> for the point on the line as a numpy.ndarray, shape=(3,)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">.d</span></code> for the distance to the point from <code class="docutils literal notranslate"><span class="pre">x</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">.lam</span></code> the <cite>lambda</cite> value for the point on the line.</p></li>
</ul>
</div></blockquote>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>Plucker.point</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.commonperp">
<code class="sig-name descname">commonperp</code><span class="sig-paren">(</span><em class="sig-param">l2</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/geom3d.html#Plucker.commonperp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.geom3d.Plucker.commonperp" title="Permalink to this definition">¶</a></dt>
<dd><p>Common perpendicular to two lines</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>l1</strong> (<a class="reference internal" href="#spatialmath.geom3d.Plucker" title="spatialmath.geom3d.Plucker"><em>Plucker</em></a>) – First line</p></li>
<li><p><strong>l2</strong> (<a class="reference internal" href="#spatialmath.geom3d.Plucker" title="spatialmath.geom3d.Plucker"><em>Plucker</em></a>) – Second line</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Perpendicular line</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.geom3d.Plucker" title="spatialmath.geom3d.Plucker">Plucker</a> or None</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">l1.commonperp(l2)</span></code> is the common perpendicular line between the two lines.
Returns <code class="docutils literal notranslate"><span class="pre">None</span></code> if the lines are parallel.</p>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>Plucker.intersect</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.__mul__">
<code class="sig-name descname">__mul__</code><span class="sig-paren">(</span><em class="sig-param">right</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/geom3d.html#Plucker.__mul__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.geom3d.Plucker.__mul__" title="Permalink to this definition">¶</a></dt>
<dd><p>Reciprocal product</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>left</strong> (<a class="reference internal" href="#spatialmath.geom3d.Plucker" title="spatialmath.geom3d.Plucker"><em>Plucker</em></a>) – Left operand</p></li>
<li><p><strong>right</strong> (<a class="reference internal" href="#spatialmath.geom3d.Plucker" title="spatialmath.geom3d.Plucker"><em>Plucker</em></a>) – Right operand</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>reciprocal product</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>float</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">left</span> <span class="pre">*</span> <span class="pre">right</span></code> is the scalar reciprocal product <span class="math notranslate nohighlight">\(\hat{w}_L \dot m_R + \hat{w}_R \dot m_R\)</span>.</p>
<p>Notes:</p>
<blockquote>
<div><ul class="simple">
<li><p>Multiplication or composition of Plucker lines is not defined.</p></li>
<li><p>Pre-multiplication by an SE3 object is supported, see <code class="docutils literal notranslate"><span class="pre">__rmul__</span></code>.</p></li>
</ul>
</div></blockquote>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>Plucker.__rmul__</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.__rmul__">
<code class="sig-name descname">__rmul__</code><span class="sig-paren">(</span><em class="sig-param">left</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/geom3d.html#Plucker.__rmul__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.geom3d.Plucker.__rmul__" title="Permalink to this definition">¶</a></dt>
<dd><p>Line transformation</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>left</strong> (<a class="reference internal" href="#spatialmath.pose3d.SE3" title="spatialmath.pose3d.SE3"><em>SE3</em></a>) – Rigid-body transform</p></li>
<li><p><strong>right</strong> (<a class="reference internal" href="#spatialmath.geom3d.Plucker" title="spatialmath.geom3d.Plucker"><em>Plucker</em></a>) – Right operand</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>transformed line</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.geom3d.Plucker" title="spatialmath.geom3d.Plucker">Plucker</a></p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">T</span> <span class="pre">*</span> <span class="pre">line</span></code> is the line transformed by the rigid body transformation <code class="docutils literal notranslate"><span class="pre">T</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>Plucker.__mul__</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.intersect_plane">
<code class="sig-name descname">intersect_plane</code><span class="sig-paren">(</span><em class="sig-param">plane</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/geom3d.html#Plucker.intersect_plane"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.geom3d.Plucker.intersect_plane" title="Permalink to this definition">¶</a></dt>
<dd><p>Line intersection with a plane</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>line</strong> (<a class="reference internal" href="#spatialmath.geom3d.Plucker" title="spatialmath.geom3d.Plucker"><em>Plucker</em></a>) – A line</p></li>
<li><p><strong>plane</strong> (<em>4-element array_like</em><em> or </em><a class="reference internal" href="#spatialmath.geom3d.Plane" title="spatialmath.geom3d.Plane"><em>Plane</em></a>) – A plane</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Intersection point</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>collections.namedtuple</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">line.intersect_plane(plane).p</span></code> is the point where the line 
intersects the plane, or None if no intersection.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">line.intersect_plane(plane).lam</span></code> is the <cite>lambda</cite> value for the point on the line
that intersects the plane.</p></li>
</ul>
<p>The plane can be specified as:</p>
<blockquote>
<div><ul class="simple">
<li><p>a 4-vector <span class="math notranslate nohighlight">\([a, b, c, d]\)</span> which describes the plane <span class="math notranslate nohighlight">\(\pi: ax + by + cz + d=0\)</span>.</p></li>
<li><p>a <code class="docutils literal notranslate"><span class="pre">Plane</span></code> object</p></li>
</ul>
<p>The return value is a named tuple with elements:</p>
<blockquote>
<div><ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">.p</span></code> for the point on the line as a numpy.ndarray, shape=(3,)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">.lam</span></code> the <cite>lambda</cite> value for the point on the line.</p></li>
</ul>
</div></blockquote>
</div></blockquote>
<p>See also Plucker.point.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.intersect_volume">
<code class="sig-name descname">intersect_volume</code><span class="sig-paren">(</span><em class="sig-param">bounds</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/geom3d.html#Plucker.intersect_volume"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.geom3d.Plucker.intersect_volume" title="Permalink to this definition">¶</a></dt>
<dd><p>Line intersection with a volume</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>line</strong> (<a class="reference internal" href="#spatialmath.geom3d.Plucker" title="spatialmath.geom3d.Plucker"><em>Plucker</em></a>) – A line</p></li>
<li><p><strong>bounds</strong> – Bounds of an axis-aligned rectangular cuboid</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Intersection point</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>collections.namedtuple</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">line.intersect_volume(bounds).p</span></code> is a matrix (3xN) with columns
that indicate where the line intersects the faces of the volume
specified by <code class="docutils literal notranslate"><span class="pre">bounds</span></code> = [xmin xmax ymin ymax zmin zmax].  The number of
columns N is either:</p>
<ul class="simple">
<li><p>0, when the line is outside the plot volume or,</p></li>
<li><p>2 when the line pierces the bounding volume.</p></li>
</ul>
<p><code class="docutils literal notranslate"><span class="pre">line.intersect_volume(bounds).lam</span></code> is an array of shape=(N,) where
N is as above.</p>
<p>The return value is a named tuple with elements:</p>
<blockquote>
<div><ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">.p</span></code> for the points on the line as a numpy.ndarray, shape=(3,N)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">.lam</span></code> for the <cite>lambda</cite> values for the intersection points as a
numpy.ndarray, shape=(N,).</p></li>
</ul>
</div></blockquote>
<p>See also Plucker.plot, Plucker.point.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.plot">
<code class="sig-name descname">plot</code><span class="sig-paren">(</span><em class="sig-param">bounds=None</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/geom3d.html#Plucker.plot"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.geom3d.Plucker.plot" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>Plot a line</p>
</div></blockquote>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>line</strong> (<a class="reference internal" href="#spatialmath.geom3d.Plucker" title="spatialmath.geom3d.Plucker"><em>Plucker</em></a>) – A line</p></li>
<li><p><strong>bounds</strong> – Bounds of an axis-aligned rectangular cuboid as [xmin xmax ymin ymax zmin zmax], optional</p></li>
<li><p><strong>**kwargs</strong> – <p>Extra arguents passed to <a class="reference external" href="https://matplotlib.org/3.2.2/api/_as_gen/matplotlib.lines.Line2D.html#matplotlib.lines.Line2D">Line2D</a></p>
</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Plotted line</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>Line3D or None</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">line.plot(bounds)</span></code> adds a line segment to the current axes, and the handle of the line is returned.  
The line segment is defined by the intersection of the line and the given rectangular cuboid. 
If the line does not intersect the plotting volume None is returned.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">line.plot()</span></code> as above but the bounds are taken from the axis limits of the current axes.</p></li>
</ul>
<p>The line color or style is specified by:</p>
<blockquote>
<div><ul class="simple">
<li><p>a  MATLAB-style linestyle like ‘k–’</p></li>
<li><p>additional arguments passed to <a class="reference external" href="https://matplotlib.org/3.2.2/api/_as_gen/matplotlib.lines.Line2D.html#matplotlib.lines.Line2D">Line2D</a></p></li>
</ul>
</div></blockquote>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>Plucker.intersect_volume</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.clear">
<code class="sig-name descname">clear</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &#x2192; None -- remove all items from S<a class="headerlink" href="#spatialmath.geom3d.Plucker.clear" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.copy">
<code class="sig-name descname">copy</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.geom3d.Plucker.copy" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.count">
<code class="sig-name descname">count</code><span class="sig-paren">(</span><em class="sig-param">value</em><span class="sig-paren">)</span> &#x2192; integer -- return number of occurrences of value<a class="headerlink" href="#spatialmath.geom3d.Plucker.count" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.extend">
<code class="sig-name descname">extend</code><span class="sig-paren">(</span><em class="sig-param">other</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.geom3d.Plucker.extend" title="Permalink to this definition">¶</a></dt>
<dd><p>S.extend(iterable) – extend sequence by appending elements from the iterable</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.index">
<code class="sig-name descname">index</code><span class="sig-paren">(</span><em class="sig-param">value</em><span class="optional">[</span>, <em class="sig-param">start</em><span class="optional">[</span>, <em class="sig-param">stop</em><span class="optional">]</span><span class="optional">]</span><span class="sig-paren">)</span> &#x2192; integer -- return first index of value.<a class="headerlink" href="#spatialmath.geom3d.Plucker.index" title="Permalink to this definition">¶</a></dt>
<dd><p>Raises ValueError if the value is not present.</p>
<p>Supporting start and stop arguments is optional, but
recommended.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.insert">
<code class="sig-name descname">insert</code><span class="sig-paren">(</span><em class="sig-param">i</em>, <em class="sig-param">item</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.geom3d.Plucker.insert" title="Permalink to this definition">¶</a></dt>
<dd><p>S.insert(index, value) – insert value before index</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.pop">
<code class="sig-name descname">pop</code><span class="sig-paren">(</span><span class="optional">[</span><em class="sig-param">index</em><span class="optional">]</span><span class="sig-paren">)</span> &#x2192; item -- remove and return item at index (default last).<a class="headerlink" href="#spatialmath.geom3d.Plucker.pop" title="Permalink to this definition">¶</a></dt>
<dd><p>Raise IndexError if list is empty or index is out of range.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.remove">
<code class="sig-name descname">remove</code><span class="sig-paren">(</span><em class="sig-param">item</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.geom3d.Plucker.remove" title="Permalink to this definition">¶</a></dt>
<dd><p>S.remove(value) – remove first occurrence of value.
Raise ValueError if the value is not present.</p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.reverse">
<code class="sig-name descname">reverse</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.geom3d.Plucker.reverse" title="Permalink to this definition">¶</a></dt>
<dd><p>S.reverse() – reverse <em>IN PLACE</em></p>
</dd></dl>

<dl class="method">
<dt id="spatialmath.geom3d.Plucker.sort">
<code class="sig-name descname">sort</code><span class="sig-paren">(</span><em class="sig-param">*args</em>, <em class="sig-param">**kwds</em><span class="sig-paren">)</span><a class="headerlink" href="#spatialmath.geom3d.Plucker.sort" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</div>
</div>
<div class="section" id="functions-base">
<h2>Functions (base)<a class="headerlink" href="#functions-base" title="Permalink to this headline">¶</a></h2>
<div class="section" id="module-spatialmath.base.transforms2d">
<span id="transforms-in-2d"></span><h3>Transforms in 2D<a class="headerlink" href="#module-spatialmath.base.transforms2d" title="Permalink to this headline">¶</a></h3>
<p>This modules contains functions to create and transform rotation matrices
and homogeneous tranformation matrices.</p>
<p>Vector arguments are what numpy refers to as <code class="docutils literal notranslate"><span class="pre">array_like</span></code> and can be a list,
tuple, numpy array, numpy row vector or numpy column vector.</p>
<dl class="function">
<dt id="spatialmath.base.transforms2d.issymbol">
<code class="sig-prename descclassname">spatialmath.base.transforms2d.</code><code class="sig-name descname">issymbol</code><span class="sig-paren">(</span><em class="sig-param">x</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms2d.html#issymbol"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms2d.issymbol" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms2d.colvec">
<code class="sig-prename descclassname">spatialmath.base.transforms2d.</code><code class="sig-name descname">colvec</code><span class="sig-paren">(</span><em class="sig-param">v</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms2d.html#colvec"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms2d.colvec" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms2d.rot2">
<code class="sig-prename descclassname">spatialmath.base.transforms2d.</code><code class="sig-name descname">rot2</code><span class="sig-paren">(</span><em class="sig-param">theta</em>, <em class="sig-param">unit='rad'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms2d.html#rot2"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms2d.rot2" title="Permalink to this definition">¶</a></dt>
<dd><p>Create SO(2) rotation</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>theta</strong> (<em>float</em>) – rotation angle</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>2x2 rotation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(2,2)</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">ROT2(THETA)</span></code> is an SO(2) rotation matrix (2x2) representing a rotation of THETA radians.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ROT2(THETA,</span> <span class="pre">'deg')</span></code> as above but THETA is in degrees.</p></li>
</ul>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms2d.trot2">
<code class="sig-prename descclassname">spatialmath.base.transforms2d.</code><code class="sig-name descname">trot2</code><span class="sig-paren">(</span><em class="sig-param">theta</em>, <em class="sig-param">unit='rad'</em>, <em class="sig-param">t=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms2d.html#trot2"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms2d.trot2" title="Permalink to this definition">¶</a></dt>
<dd><p>Create SE(2) pure rotation</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>theta</strong> (<em>float</em>) – rotation angle about X-axis</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p></li>
<li><p><strong>t</strong> (<em>array_like    :return: 3x3 homogeneous transformation matrix</em>) – translation 2-vector, defaults to [0,0]</p></li>
</ul>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>numpy.ndarray, shape=(3,3)</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">TROT2(THETA)</span></code> is a homogeneous transformation (3x3) representing a rotation of
THETA radians.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">TROT2(THETA,</span> <span class="pre">'deg')</span></code> as above but THETA is in degrees.</p></li>
</ul>
<p>Notes:
- Translational component is zero.</p>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms2d.transl2">
<code class="sig-prename descclassname">spatialmath.base.transforms2d.</code><code class="sig-name descname">transl2</code><span class="sig-paren">(</span><em class="sig-param">x</em>, <em class="sig-param">y=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms2d.html#transl2"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms2d.transl2" title="Permalink to this definition">¶</a></dt>
<dd><p>Create SE(2) pure translation, or extract translation from SE(2) matrix</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<em>float</em>) – translation along X-axis</p></li>
<li><p><strong>y</strong> (<em>float</em>) – translation along Y-axis</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>homogeneous transform matrix or the translation elements of a homogeneous transform</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(3,3)</p>
</dd>
</dl>
<p>Create a translational SE(2) matrix:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">T</span> <span class="pre">=</span> <span class="pre">transl2([X,</span> <span class="pre">Y])</span></code> is an SE(2) homogeneous transform (3x3) representing a
pure translation.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">T</span> <span class="pre">=</span> <span class="pre">transl2(</span> <span class="pre">V</span> <span class="pre">)</span></code> as above but the translation is given by a 2-element
list, dict, or a numpy array, row or column vector.</p></li>
</ul>
<p>Extract the translational part of an SE(2) matrix:</p>
<p>P = TRANSL2(T) is the translational part of a homogeneous transform as a
2-element numpy array.</p>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms2d.ishom2">
<code class="sig-prename descclassname">spatialmath.base.transforms2d.</code><code class="sig-name descname">ishom2</code><span class="sig-paren">(</span><em class="sig-param">T</em>, <em class="sig-param">check=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms2d.html#ishom2"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms2d.ishom2" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if matrix belongs to SE(2)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>T</strong> (<em>numpy.ndarray</em>) – matrix to test</p></li>
<li><p><strong>check</strong> (<em>bool</em>) – check validity of rotation submatrix</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>whether matrix is an SE(2) homogeneous transformation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">ISHOM2(T)</span></code> is True if the argument <code class="docutils literal notranslate"><span class="pre">T</span></code> is of dimension 3x3</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ISHOM2(T,</span> <span class="pre">check=True)</span></code> as above, but also checks orthogonality of the rotation sub-matrix and
validitity of the bottom row.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>isR, isrot2, ishom, isvec</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms2d.isrot2">
<code class="sig-prename descclassname">spatialmath.base.transforms2d.</code><code class="sig-name descname">isrot2</code><span class="sig-paren">(</span><em class="sig-param">R</em>, <em class="sig-param">check=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms2d.html#isrot2"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms2d.isrot2" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if matrix belongs to SO(2)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>R</strong> (<em>numpy.ndarray</em>) – matrix to test</p></li>
<li><p><strong>check</strong> (<em>bool</em>) – check validity of rotation submatrix</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>whether matrix is an SO(2) rotation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">ISROT(R)</span></code> is True if the argument <code class="docutils literal notranslate"><span class="pre">R</span></code> is of dimension 2x2</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ISROT(R,</span> <span class="pre">check=True)</span></code> as above, but also checks orthogonality of the rotation matrix.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>isR, ishom2, isrot</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms2d.trlog2">
<code class="sig-prename descclassname">spatialmath.base.transforms2d.</code><code class="sig-name descname">trlog2</code><span class="sig-paren">(</span><em class="sig-param">T</em>, <em class="sig-param">check=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms2d.html#trlog2"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms2d.trlog2" title="Permalink to this definition">¶</a></dt>
<dd><p>Logarithm of SO(2) or SE(2) matrix</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>T</strong> (<em>numpy.ndarray</em><em>, </em><em>shape=</em><em>(</em><em>2</em><em>,</em><em>2</em><em>) or </em><em>(</em><em>3</em><em>,</em><em>3</em><em>)</em>) – SO(2) or SE(2) matrix</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>logarithm</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(2,2) or (3,3)</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>ValueError</p>
</dd>
</dl>
<p>An efficient closed-form solution of the matrix logarithm for arguments that are SO(2) or SE(2).</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">trlog2(R)</span></code> is the logarithm of the passed rotation matrix <code class="docutils literal notranslate"><span class="pre">R</span></code> which will be
2x2 skew-symmetric matrix.  The equivalent vector from <code class="docutils literal notranslate"><span class="pre">vex()</span></code> is parallel to rotation axis
and its norm is the amount of rotation about that axis.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">trlog(T)</span></code> is the logarithm of the passed homogeneous transformation matrix <code class="docutils literal notranslate"><span class="pre">T</span></code> which will be
3x3 augumented skew-symmetric matrix. The equivalent vector from <code class="docutils literal notranslate"><span class="pre">vexa()</span></code> is the twist
vector (6x1) comprising [v w].</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><code class="xref py py-func docutils literal notranslate"><span class="pre">trexp()</span></code>, <a class="reference internal" href="#spatialmath.base.transformsNd.vex" title="spatialmath.base.transformsNd.vex"><code class="xref py py-func docutils literal notranslate"><span class="pre">vex()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transformsNd.vexa" title="spatialmath.base.transformsNd.vexa"><code class="xref py py-func docutils literal notranslate"><span class="pre">vexa()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms2d.trexp2">
<code class="sig-prename descclassname">spatialmath.base.transforms2d.</code><code class="sig-name descname">trexp2</code><span class="sig-paren">(</span><em class="sig-param">S</em>, <em class="sig-param">theta=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms2d.html#trexp2"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms2d.trexp2" title="Permalink to this definition">¶</a></dt>
<dd><p>Exponential of so(2) or se(2) matrix</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>S</strong> – so(2), se(2) matrix or equivalent velctor</p></li>
<li><p><strong>theta</strong> (<em>float</em>) – motion</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>2x2 or 3x3 matrix exponential in SO(2) or SE(2)</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(2,2) or (3,3)</p>
</dd>
</dl>
<p>An efficient closed-form solution of the matrix exponential for arguments
that are so(2) or se(2).</p>
<p>For so(2) the results is an SO(2) rotation matrix:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">trexp2(S)</span></code> is the matrix exponential of the so(3) element <code class="docutils literal notranslate"><span class="pre">S</span></code> which is a 2x2
skew-symmetric matrix.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">trexp2(S,</span> <span class="pre">THETA)</span></code> as above but for an so(3) motion of S*THETA, where <code class="docutils literal notranslate"><span class="pre">S</span></code> is
unit-norm skew-symmetric matrix representing a rotation axis and a rotation magnitude
given by <code class="docutils literal notranslate"><span class="pre">THETA</span></code>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">trexp2(W)</span></code> is the matrix exponential of the so(2) element <code class="docutils literal notranslate"><span class="pre">W</span></code> expressed as
a 1-vector (array_like).</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">trexp2(W,</span> <span class="pre">THETA)</span></code> as above but for an so(3) motion of W*THETA where <code class="docutils literal notranslate"><span class="pre">W</span></code> is a
unit-norm vector representing a rotation axis and a rotation magnitude
given by <code class="docutils literal notranslate"><span class="pre">THETA</span></code>. <code class="docutils literal notranslate"><span class="pre">W</span></code> is expressed as a 1-vector (array_like).</p></li>
</ul>
<p>For se(2) the results is an SE(2) homogeneous transformation matrix:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">trexp2(SIGMA)</span></code> is the matrix exponential of the se(2) element <code class="docutils literal notranslate"><span class="pre">SIGMA</span></code> which is
a 3x3 augmented skew-symmetric matrix.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">trexp2(SIGMA,</span> <span class="pre">THETA)</span></code> as above but for an se(3) motion of SIGMA*THETA, where <code class="docutils literal notranslate"><span class="pre">SIGMA</span></code>
must represent a unit-twist, ie. the rotational component is a unit-norm skew-symmetric
matrix.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">trexp2(TW)</span></code> is the matrix exponential of the se(3) element <code class="docutils literal notranslate"><span class="pre">TW</span></code> represented as
a 3-vector which can be considered a screw motion.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">trexp2(TW,</span> <span class="pre">THETA)</span></code> as above but for an se(2) motion of TW*THETA, where <code class="docutils literal notranslate"><span class="pre">TW</span></code>
must represent a unit-twist, ie. the rotational component is a unit-norm skew-symmetric
matrix.</p></li>
</ul>
<blockquote>
<div><dl class="field-list simple">
<dt class="field-odd">seealso</dt>
<dd class="field-odd"><p>trlog, trexp2</p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms2d.trinterp2">
<code class="sig-prename descclassname">spatialmath.base.transforms2d.</code><code class="sig-name descname">trinterp2</code><span class="sig-paren">(</span><em class="sig-param">T0</em>, <em class="sig-param">T1=None</em>, <em class="sig-param">s=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms2d.html#trinterp2"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms2d.trinterp2" title="Permalink to this definition">¶</a></dt>
<dd><p>Interpolate SE(2) matrices</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>T0</strong> (<em>np.ndarray</em><em>, </em><em>shape=</em><em>(</em><em>3</em><em>,</em><em>3</em><em>)</em>) – first SE(2) matrix</p></li>
<li><p><strong>T1</strong> (<em>np.ndarray</em><em>, </em><em>shape=</em><em>(</em><em>3</em><em>,</em><em>3</em><em>)</em>) – second SE(2) matrix</p></li>
<li><p><strong>s</strong> (<em>float</em>) – interpolation coefficient, range 0 to 1</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>SE(2) matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>np.ndarray, shape=(3,3)</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">trinterp2(T0,</span> <span class="pre">T1,</span> <span class="pre">S)</span></code> is a homogeneous transform (3x3) interpolated
between T0 when S=0 and T1 when S=1.  T0 and T1 are both homogeneous
transforms (3x3).</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">trinterp2(T1,</span> <span class="pre">S)</span></code> as above but interpolated between the identity matrix
when S=0 to T1 when S=1.</p></li>
</ul>
<p>Notes:</p>
<ul class="simple">
<li><p>Rotation angle is linearly interpolated.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.trinterp" title="spatialmath.base.transforms3d.trinterp"><code class="xref py py-func docutils literal notranslate"><span class="pre">trinterp()</span></code></a></p>
</dd>
</dl>
<p>%## 2d homogeneous trajectory</p>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms2d.trprint2">
<code class="sig-prename descclassname">spatialmath.base.transforms2d.</code><code class="sig-name descname">trprint2</code><span class="sig-paren">(</span><em class="sig-param">T</em>, <em class="sig-param">label=None</em>, <em class="sig-param">file=&lt;_io.TextIOWrapper name='&lt;stdout&gt;' mode='w' encoding='UTF-8'&gt;</em>, <em class="sig-param">fmt='{:8.2g}'</em>, <em class="sig-param">unit='deg'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms2d.html#trprint2"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms2d.trprint2" title="Permalink to this definition">¶</a></dt>
<dd><p>Compact display of SO(2) or SE(2) matrices</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>T</strong> (<em>numpy.ndarray</em><em>, </em><em>shape=</em><em>(</em><em>2</em><em>,</em><em>2</em><em>) or </em><em>(</em><em>3</em><em>,</em><em>3</em><em>)</em>) – matrix to format</p></li>
<li><p><strong>label</strong> (<em>str</em>) – text label to put at start of line</p></li>
<li><p><strong>file</strong> (<em>str</em>) – file to write formatted string to</p></li>
<li><p><strong>fmt</strong> (<em>str</em>) – conversion format for each number</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>optional formatted string</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
<p>The matrix is formatted and written to <code class="docutils literal notranslate"><span class="pre">file</span></code> or if <code class="docutils literal notranslate"><span class="pre">file=None</span></code> then the
string is returned.</p>
<ul>
<li><p><code class="docutils literal notranslate"><span class="pre">trprint2(R)</span></code> displays the SO(2) rotation matrix in a compact
single-line format:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">LABEL</span><span class="p">:]</span> <span class="n">THETA</span> <span class="n">UNIT</span>
</pre></div>
</div>
</li>
<li><p><code class="docutils literal notranslate"><span class="pre">trprint2(T)</span></code> displays the SE(2) homogoneous transform in a compact
single-line format:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">LABEL</span><span class="p">:]</span> <span class="p">[</span><span class="n">t</span><span class="o">=</span><span class="n">X</span><span class="p">,</span> <span class="n">Y</span><span class="p">;]</span> <span class="n">THETA</span> <span class="n">UNIT</span>
</pre></div>
</div>
</li>
</ul>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">T</span> <span class="o">=</span> <span class="n">transl2</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span><span class="mi">2</span><span class="p">)</span><span class="nd">@trot2</span><span class="p">(</span><span class="mf">0.3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">trprint2</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">file</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s1">&#39;T&#39;</span><span class="p">)</span>
<span class="go">&#39;T: t =        1,        2;       17 deg&#39;</span>
</pre></div>
</div>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>trprint</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms2d.trplot2">
<code class="sig-prename descclassname">spatialmath.base.transforms2d.</code><code class="sig-name descname">trplot2</code><span class="sig-paren">(</span><em class="sig-param">T, axes=None, dims=None, color='blue', frame=None, textcolor=None, labels=['X', 'Y'], length=1, arrow=True, rviz=False, wtl=0.2, width=1, d1=0.05, d2=1.15, **kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms2d.html#trplot2"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms2d.trplot2" title="Permalink to this definition">¶</a></dt>
<dd><p>Plot a 2D coordinate frame</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>T</strong> – an SO(3) or SE(3) pose to be displayed as coordinate frame</p></li>
<li><p><strong>axes</strong> (<em>Axes3D reference</em>) – the axes to plot into, defaults to current axes</p></li>
<li><p><strong>dims</strong> (<em>array_like</em>) – dimension of plot volume as [xmin, xmax, ymin, ymax]</p></li>
<li><p><strong>color</strong> (<em>str</em>) – color of the lines defining the frame</p></li>
<li><p><strong>textcolor</strong> (<em>str</em>) – color of text labels for the frame, default color of lines above</p></li>
<li><p><strong>frame</strong> (<em>str</em>) – label the frame, name is shown below the frame and as subscripts on the frame axis labels</p></li>
<li><p><strong>labels</strong> (<em>3-tuple of strings</em>) – labels for the axes, defaults to X, Y and Z</p></li>
<li><p><strong>length</strong> (<em>float</em>) – length of coordinate frame axes, default 1</p></li>
<li><p><strong>arrow</strong> (<em>bool</em>) – show arrow heads, default True</p></li>
<li><p><strong>wtl</strong> (<em>float</em>) – width-to-length ratio for arrows, default 0.2</p></li>
<li><p><strong>rviz</strong> (<em>bool</em>) – show Rviz style arrows, default False</p></li>
<li><p><strong>projection</strong> (<em>str</em>) – 3D projection: ortho [default] or persp</p></li>
<li><p><strong>width</strong> (<em>float</em>) – width of lines, default 1</p></li>
<li><p><strong>d1</strong> – distance of frame axis label text from origin, default 1.15</p></li>
</ul>
</dd>
<dt class="field-even">Type</dt>
<dd class="field-even"><p>numpy.ndarray, shape=(2,2) or (3,3)</p>
</dd>
</dl>
<p>Adds a 2D coordinate frame represented by the SO(2) or SE(2) matrix to the current axes.</p>
<ul class="simple">
<li><p>If no current figure, one is created</p></li>
<li><p>If current figure, but no axes, a 3d Axes is created</p></li>
</ul>
<p>Examples:</p>
<blockquote>
<div><p>trplot2(T, frame=’A’)
trplot2(T, frame=’A’, color=’green’)
trplot2(T1, ‘labels’, ‘AB’);</p>
</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms2d.tranimate2">
<code class="sig-prename descclassname">spatialmath.base.transforms2d.</code><code class="sig-name descname">tranimate2</code><span class="sig-paren">(</span><em class="sig-param">T</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms2d.html#tranimate2"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms2d.tranimate2" title="Permalink to this definition">¶</a></dt>
<dd><p>Animate a 2D coordinate frame</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>T</strong> – an SO(2) or SE(2) pose to be displayed as coordinate frame</p></li>
<li><p><strong>nframes</strong> (<em>int</em>) – number of steps in the animation [defaault 100]</p></li>
<li><p><strong>repeat</strong> (<em>bool</em>) – animate in endless loop [default False]</p></li>
<li><p><strong>interval</strong> (<em>int</em>) – number of milliseconds between frames [default 50]</p></li>
<li><p><strong>movie</strong> (<em>str</em>) – name of file to write MP4 movie into</p></li>
</ul>
</dd>
<dt class="field-even">Type</dt>
<dd class="field-even"><p>numpy.ndarray, shape=(2,2) or (3,3)</p>
</dd>
</dl>
<p>Animates a 2D coordinate frame moving from the world frame to a frame represented by the SO(2) or SE(2) matrix to the current axes.</p>
<ul class="simple">
<li><p>If no current figure, one is created</p></li>
<li><p>If current figure, but no axes, a 3d Axes is created</p></li>
</ul>
<p>Examples:</p>
<blockquote>
<div><p>tranimate2(transl(1,2)&#64;trot2(1), frame=’A’, arrow=False, dims=[0, 5])
tranimate2(transl(1,2)&#64;trot2(1), frame=’A’, arrow=False, dims=[0, 5], movie=’spin.mp4’)</p>
</div></blockquote>
</dd></dl>

</div>
<div class="section" id="module-spatialmath.base.transforms3d">
<span id="transforms-in-3d"></span><h3>Transforms in 3D<a class="headerlink" href="#module-spatialmath.base.transforms3d" title="Permalink to this headline">¶</a></h3>
<p>This modules contains functions to create and transform 3D rotation matrices
and homogeneous tranformation matrices.</p>
<p>Vector arguments are what numpy refers to as <code class="docutils literal notranslate"><span class="pre">array_like</span></code> and can be a list,
tuple, numpy array, numpy row vector or numpy column vector.</p>
<p>TODO:</p>
<blockquote>
<div><ul class="simple">
<li><p>trinterp</p></li>
<li><p>trjac, trjac2</p></li>
<li><p>tranimate, tranimate2</p></li>
</ul>
</div></blockquote>
<dl class="function">
<dt id="spatialmath.base.transforms3d.issymbol">
<code class="sig-prename descclassname">spatialmath.base.transforms3d.</code><code class="sig-name descname">issymbol</code><span class="sig-paren">(</span><em class="sig-param">x</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms3d.html#issymbol"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms3d.issymbol" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms3d.colvec">
<code class="sig-prename descclassname">spatialmath.base.transforms3d.</code><code class="sig-name descname">colvec</code><span class="sig-paren">(</span><em class="sig-param">v</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms3d.html#colvec"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms3d.colvec" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms3d.rotx">
<code class="sig-prename descclassname">spatialmath.base.transforms3d.</code><code class="sig-name descname">rotx</code><span class="sig-paren">(</span><em class="sig-param">theta</em>, <em class="sig-param">unit='rad'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms3d.html#rotx"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms3d.rotx" title="Permalink to this definition">¶</a></dt>
<dd><p>Create SO(3) rotation about X-axis</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>theta</strong> (<em>float</em>) – rotation angle about X-axis</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>3x3 rotation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(3,3)</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">rotx(THETA)</span></code> is an SO(3) rotation matrix (3x3) representing a rotation
of THETA radians about the x-axis</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">rotx(THETA,</span> <span class="pre">&quot;deg&quot;)</span></code> as above but THETA is in degrees</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.trotx" title="spatialmath.base.transforms3d.trotx"><code class="xref py py-func docutils literal notranslate"><span class="pre">trotx()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms3d.roty">
<code class="sig-prename descclassname">spatialmath.base.transforms3d.</code><code class="sig-name descname">roty</code><span class="sig-paren">(</span><em class="sig-param">theta</em>, <em class="sig-param">unit='rad'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms3d.html#roty"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms3d.roty" title="Permalink to this definition">¶</a></dt>
<dd><p>Create SO(3) rotation about Y-axis</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>theta</strong> (<em>float</em>) – rotation angle about Y-axis</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>3x3 rotation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(3,3)</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">roty(THETA)</span></code> is an SO(3) rotation matrix (3x3) representing a rotation
of THETA radians about the y-axis</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">roty(THETA,</span> <span class="pre">&quot;deg&quot;)</span></code> as above but THETA is in degrees</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.troty" title="spatialmath.base.transforms3d.troty"><code class="xref py py-func docutils literal notranslate"><span class="pre">troty()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms3d.rotz">
<code class="sig-prename descclassname">spatialmath.base.transforms3d.</code><code class="sig-name descname">rotz</code><span class="sig-paren">(</span><em class="sig-param">theta</em>, <em class="sig-param">unit='rad'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms3d.html#rotz"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms3d.rotz" title="Permalink to this definition">¶</a></dt>
<dd><p>Create SO(3) rotation about Z-axis</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>theta</strong> (<em>float</em>) – rotation angle about Z-axis</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>3x3 rotation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(3,3)</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">rotz(THETA)</span></code> is an SO(3) rotation matrix (3x3) representing a rotation
of THETA radians about the z-axis</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">rotz(THETA,</span> <span class="pre">&quot;deg&quot;)</span></code> as above but THETA is in degrees</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><code class="xref py py-func docutils literal notranslate"><span class="pre">yrotz()</span></code></p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms3d.trotx">
<code class="sig-prename descclassname">spatialmath.base.transforms3d.</code><code class="sig-name descname">trotx</code><span class="sig-paren">(</span><em class="sig-param">theta</em>, <em class="sig-param">unit='rad'</em>, <em class="sig-param">t=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms3d.html#trotx"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms3d.trotx" title="Permalink to this definition">¶</a></dt>
<dd><p>Create SE(3) pure rotation about X-axis</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>theta</strong> (<em>float</em>) – rotation angle about X-axis</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p></li>
<li><p><strong>t</strong> (<em>array_like    :return: 4x4 homogeneous transformation matrix</em>) – translation 3-vector, defaults to [0,0,0]</p></li>
</ul>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>numpy.ndarray, shape=(4,4)</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">trotx(THETA)</span></code> is a homogeneous transformation (4x4) representing a rotation
of THETA radians about the x-axis.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">trotx(THETA,</span> <span class="pre">'deg')</span></code> as above but THETA is in degrees</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">trotx(THETA,</span> <span class="pre">'rad',</span> <span class="pre">t=[x,y,z])</span></code> as above with translation of [x,y,z]</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.rotx" title="spatialmath.base.transforms3d.rotx"><code class="xref py py-func docutils literal notranslate"><span class="pre">rotx()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms3d.troty">
<code class="sig-prename descclassname">spatialmath.base.transforms3d.</code><code class="sig-name descname">troty</code><span class="sig-paren">(</span><em class="sig-param">theta</em>, <em class="sig-param">unit='rad'</em>, <em class="sig-param">t=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms3d.html#troty"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms3d.troty" title="Permalink to this definition">¶</a></dt>
<dd><p>Create SE(3) pure rotation about Y-axis</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>theta</strong> (<em>float</em>) – rotation angle about Y-axis</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p></li>
<li><p><strong>t</strong> (<em>array_like</em>) – translation 3-vector, defaults to [0,0,0]</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>4x4 homogeneous transformation matrix as a numpy array</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(4,4)</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">troty(THETA)</span></code> is a homogeneous transformation (4x4) representing a rotation
of THETA radians about the y-axis.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">troty(THETA,</span> <span class="pre">'deg')</span></code> as above but THETA is in degrees</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">troty(THETA,</span> <span class="pre">'rad',</span> <span class="pre">t=[x,y,z])</span></code> as above with translation of [x,y,z]</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.roty" title="spatialmath.base.transforms3d.roty"><code class="xref py py-func docutils literal notranslate"><span class="pre">roty()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms3d.trotz">
<code class="sig-prename descclassname">spatialmath.base.transforms3d.</code><code class="sig-name descname">trotz</code><span class="sig-paren">(</span><em class="sig-param">theta</em>, <em class="sig-param">unit='rad'</em>, <em class="sig-param">t=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms3d.html#trotz"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms3d.trotz" title="Permalink to this definition">¶</a></dt>
<dd><p>Create SE(3) pure rotation about Z-axis</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>theta</strong> (<em>float</em>) – rotation angle about Z-axis</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p></li>
<li><p><strong>t</strong> (<em>array_like</em>) – translation 3-vector, defaults to [0,0,0]</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>4x4 homogeneous transformation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(4,4)</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">trotz(THETA)</span></code> is a homogeneous transformation (4x4) representing a rotation
of THETA radians about the z-axis.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">trotz(THETA,</span> <span class="pre">'deg')</span></code> as above but THETA is in degrees</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">trotz(THETA,</span> <span class="pre">'rad',</span> <span class="pre">t=[x,y,z])</span></code> as above with translation of [x,y,z]</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.rotz" title="spatialmath.base.transforms3d.rotz"><code class="xref py py-func docutils literal notranslate"><span class="pre">rotz()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms3d.transl">
<code class="sig-prename descclassname">spatialmath.base.transforms3d.</code><code class="sig-name descname">transl</code><span class="sig-paren">(</span><em class="sig-param">x</em>, <em class="sig-param">y=None</em>, <em class="sig-param">z=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms3d.html#transl"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms3d.transl" title="Permalink to this definition">¶</a></dt>
<dd><p>Create SE(3) pure translation, or extract translation from SE(3) matrix</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>x</strong> (<em>float</em>) – translation along X-axis</p></li>
<li><p><strong>y</strong> (<em>float</em>) – translation along Y-axis</p></li>
<li><p><strong>z</strong> (<em>float</em>) – translation along Z-axis</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>4x4 homogeneous transformation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(4,4)</p>
</dd>
</dl>
<p>Create a translational SE(3) matrix:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">T</span> <span class="pre">=</span> <span class="pre">transl(</span> <span class="pre">X,</span> <span class="pre">Y,</span> <span class="pre">Z</span> <span class="pre">)</span></code> is an SE(3) homogeneous transform (4x4) representing a
pure translation of X, Y and Z.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">T</span> <span class="pre">=</span> <span class="pre">transl(</span> <span class="pre">V</span> <span class="pre">)</span></code> as above but the translation is given by a 3-element
list, dict, or a numpy array, row or column vector.</p></li>
</ul>
<p>Extract the translational part of an SE(3) matrix:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">P</span> <span class="pre">=</span> <span class="pre">TRANSL(T)</span></code> is the translational part of a homogeneous transform T as a
3-element numpy array.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms2d.transl2" title="spatialmath.base.transforms2d.transl2"><code class="xref py py-func docutils literal notranslate"><span class="pre">transl2()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms3d.ishom">
<code class="sig-prename descclassname">spatialmath.base.transforms3d.</code><code class="sig-name descname">ishom</code><span class="sig-paren">(</span><em class="sig-param">T</em>, <em class="sig-param">check=False</em>, <em class="sig-param">tol=10</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms3d.html#ishom"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms3d.ishom" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if matrix belongs to SE(3)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>T</strong> (<em>numpy.ndarray</em>) – matrix to test</p></li>
<li><p><strong>check</strong> (<em>bool</em>) – check validity of rotation submatrix</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>whether matrix is an SE(3) homogeneous transformation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">ISHOM(T)</span></code> is True if the argument <code class="docutils literal notranslate"><span class="pre">T</span></code> is of dimension 4x4</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ISHOM(T,</span> <span class="pre">check=True)</span></code> as above, but also checks orthogonality of the rotation sub-matrix and
validitity of the bottom row.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transformsNd.isR" title="spatialmath.base.transformsNd.isR"><code class="xref py py-func docutils literal notranslate"><span class="pre">isR()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms3d.isrot" title="spatialmath.base.transforms3d.isrot"><code class="xref py py-func docutils literal notranslate"><span class="pre">isrot()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms2d.ishom2" title="spatialmath.base.transforms2d.ishom2"><code class="xref py py-func docutils literal notranslate"><span class="pre">ishom2()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms3d.isrot">
<code class="sig-prename descclassname">spatialmath.base.transforms3d.</code><code class="sig-name descname">isrot</code><span class="sig-paren">(</span><em class="sig-param">R</em>, <em class="sig-param">check=False</em>, <em class="sig-param">tol=10</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms3d.html#isrot"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms3d.isrot" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if matrix belongs to SO(3)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>R</strong> (<em>numpy.ndarray</em>) – matrix to test</p></li>
<li><p><strong>check</strong> (<em>bool</em>) – check validity of rotation submatrix</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>whether matrix is an SO(3) rotation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">ISROT(R)</span></code> is True if the argument <code class="docutils literal notranslate"><span class="pre">R</span></code> is of dimension 3x3</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">ISROT(R,</span> <span class="pre">check=True)</span></code> as above, but also checks orthogonality of the rotation matrix.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transformsNd.isR" title="spatialmath.base.transformsNd.isR"><code class="xref py py-func docutils literal notranslate"><span class="pre">isR()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms2d.isrot2" title="spatialmath.base.transforms2d.isrot2"><code class="xref py py-func docutils literal notranslate"><span class="pre">isrot2()</span></code></a>,  <a class="reference internal" href="#spatialmath.base.transforms3d.ishom" title="spatialmath.base.transforms3d.ishom"><code class="xref py py-func docutils literal notranslate"><span class="pre">ishom()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms3d.rpy2r">
<code class="sig-prename descclassname">spatialmath.base.transforms3d.</code><code class="sig-name descname">rpy2r</code><span class="sig-paren">(</span><em class="sig-param">roll</em>, <em class="sig-param">pitch=None</em>, <em class="sig-param">yaw=None</em>, <em class="sig-param">*</em>, <em class="sig-param">unit='rad'</em>, <em class="sig-param">order='zyx'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms3d.html#rpy2r"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms3d.rpy2r" title="Permalink to this definition">¶</a></dt>
<dd><p>Create an SO(3) rotation matrix from roll-pitch-yaw angles</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>roll</strong> (<em>float</em>) – roll angle</p></li>
<li><p><strong>pitch</strong> (<em>float</em>) – pitch angle</p></li>
<li><p><strong>yaw</strong> (<em>float</em>) – yaw angle</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p></li>
<li><p><strong>unit</strong> – rotation order: ‘zyx’ [default], ‘xyz’, or ‘yxz’</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>3x3 rotation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpdy.ndarray, shape=(3,3)</p>
</dd>
</dl>
<ul>
<li><p><code class="docutils literal notranslate"><span class="pre">rpy2r(ROLL,</span> <span class="pre">PITCH,</span> <span class="pre">YAW)</span></code> is an SO(3) orthonormal rotation matrix
(3x3) equivalent to the specified roll, pitch, yaw angles angles.
These correspond to successive rotations about the axes specified by <code class="docutils literal notranslate"><span class="pre">order</span></code>:</p>
<blockquote>
<div><ul class="simple">
<li><p>‘zyx’ [default], rotate by yaw about the z-axis, then by pitch about the new y-axis,
then by roll about the new x-axis.  Convention for a mobile robot with x-axis forward
and y-axis sideways.</p></li>
<li><p>‘xyz’, rotate by yaw about the x-axis, then by pitch about the new y-axis,
then by roll about the new z-axis. Covention for a robot gripper with z-axis forward
and y-axis between the gripper fingers.</p></li>
<li><p>‘yxz’, rotate by yaw about the y-axis, then by pitch about the new x-axis,
then by roll about the new z-axis. Convention for a camera with z-axis parallel
to the optic axis and x-axis parallel to the pixel rows.</p></li>
</ul>
</div></blockquote>
</li>
<li><p><code class="docutils literal notranslate"><span class="pre">rpy2r(RPY)</span></code> as above but the roll, pitch, yaw angles are taken
from <code class="docutils literal notranslate"><span class="pre">RPY</span></code> which is a 3-vector (array_like) with values
(ROLL, PITCH, YAW).</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.eul2r" title="spatialmath.base.transforms3d.eul2r"><code class="xref py py-func docutils literal notranslate"><span class="pre">eul2r()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms3d.rpy2tr" title="spatialmath.base.transforms3d.rpy2tr"><code class="xref py py-func docutils literal notranslate"><span class="pre">rpy2tr()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms3d.tr2rpy" title="spatialmath.base.transforms3d.tr2rpy"><code class="xref py py-func docutils literal notranslate"><span class="pre">tr2rpy()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms3d.rpy2tr">
<code class="sig-prename descclassname">spatialmath.base.transforms3d.</code><code class="sig-name descname">rpy2tr</code><span class="sig-paren">(</span><em class="sig-param">roll</em>, <em class="sig-param">pitch=None</em>, <em class="sig-param">yaw=None</em>, <em class="sig-param">unit='rad'</em>, <em class="sig-param">order='zyx'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms3d.html#rpy2tr"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms3d.rpy2tr" title="Permalink to this definition">¶</a></dt>
<dd><p>Create an SE(3) rotation matrix from roll-pitch-yaw angles</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>roll</strong> (<em>float</em>) – roll angle</p></li>
<li><p><strong>pitch</strong> (<em>float</em>) – pitch angle</p></li>
<li><p><strong>yaw</strong> (<em>float</em>) – yaw angle</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p></li>
<li><p><strong>unit</strong> – rotation order: ‘zyx’ [default], ‘xyz’, or ‘yxz’</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>3x3 rotation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpdy.ndarray, shape=(3,3)</p>
</dd>
</dl>
<ul>
<li><p><code class="docutils literal notranslate"><span class="pre">rpy2tr(ROLL,</span> <span class="pre">PITCH,</span> <span class="pre">YAW)</span></code> is an SO(3) orthonormal rotation matrix
(3x3) equivalent to the specified roll, pitch, yaw angles angles.
These correspond to successive rotations about the axes specified by <code class="docutils literal notranslate"><span class="pre">order</span></code>:</p>
<blockquote>
<div><ul class="simple">
<li><p>‘zyx’ [default], rotate by yaw about the z-axis, then by pitch about the new y-axis,
then by roll about the new x-axis.  Convention for a mobile robot with x-axis forward
and y-axis sideways.</p></li>
<li><p>‘xyz’, rotate by yaw about the x-axis, then by pitch about the new y-axis,
then by roll about the new z-axis. Convention for a robot gripper with z-axis forward
and y-axis between the gripper fingers.</p></li>
<li><p>‘yxz’, rotate by yaw about the y-axis, then by pitch about the new x-axis,
then by roll about the new z-axis. Convention for a camera with z-axis parallel
to the optic axis and x-axis parallel to the pixel rows.</p></li>
</ul>
</div></blockquote>
</li>
<li><p><code class="docutils literal notranslate"><span class="pre">rpy2tr(RPY)</span></code> as above but the roll, pitch, yaw angles are taken
from <code class="docutils literal notranslate"><span class="pre">RPY</span></code> which is a 3-vector (array_like) with values
(ROLL, PITCH, YAW).</p></li>
</ul>
<p>Notes:</p>
<ul class="simple">
<li><p>The translational part is zero.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.eul2tr" title="spatialmath.base.transforms3d.eul2tr"><code class="xref py py-func docutils literal notranslate"><span class="pre">eul2tr()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms3d.rpy2r" title="spatialmath.base.transforms3d.rpy2r"><code class="xref py py-func docutils literal notranslate"><span class="pre">rpy2r()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms3d.tr2rpy" title="spatialmath.base.transforms3d.tr2rpy"><code class="xref py py-func docutils literal notranslate"><span class="pre">tr2rpy()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms3d.eul2r">
<code class="sig-prename descclassname">spatialmath.base.transforms3d.</code><code class="sig-name descname">eul2r</code><span class="sig-paren">(</span><em class="sig-param">phi</em>, <em class="sig-param">theta=None</em>, <em class="sig-param">psi=None</em>, <em class="sig-param">unit='rad'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms3d.html#eul2r"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms3d.eul2r" title="Permalink to this definition">¶</a></dt>
<dd><p>Create an SO(3) rotation matrix from Euler angles</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>phi</strong> (<em>float</em>) – Z-axis rotation</p></li>
<li><p><strong>theta</strong> (<em>float</em>) – Y-axis rotation</p></li>
<li><p><strong>psi</strong> (<em>float</em>) – Z-axis rotation</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>3x3 rotation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpdy.ndarray, shape=(3,3)</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">R</span> <span class="pre">=</span> <span class="pre">eul2r(PHI,</span> <span class="pre">THETA,</span> <span class="pre">PSI)</span></code> is an SO(3) orthonornal rotation
matrix equivalent to the specified Euler angles.  These correspond
to rotations about the Z, Y, Z axes respectively.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">R</span> <span class="pre">=</span> <span class="pre">eul2r(EUL)</span></code> as above but the Euler angles are taken from
<code class="docutils literal notranslate"><span class="pre">EUL</span></code> which is a 3-vector (array_like) with values
(PHI THETA PSI).</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.rpy2r" title="spatialmath.base.transforms3d.rpy2r"><code class="xref py py-func docutils literal notranslate"><span class="pre">rpy2r()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms3d.eul2tr" title="spatialmath.base.transforms3d.eul2tr"><code class="xref py py-func docutils literal notranslate"><span class="pre">eul2tr()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms3d.tr2eul" title="spatialmath.base.transforms3d.tr2eul"><code class="xref py py-func docutils literal notranslate"><span class="pre">tr2eul()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms3d.eul2tr">
<code class="sig-prename descclassname">spatialmath.base.transforms3d.</code><code class="sig-name descname">eul2tr</code><span class="sig-paren">(</span><em class="sig-param">phi</em>, <em class="sig-param">theta=None</em>, <em class="sig-param">psi=None</em>, <em class="sig-param">unit='rad'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms3d.html#eul2tr"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms3d.eul2tr" title="Permalink to this definition">¶</a></dt>
<dd><p>Create an SE(3) pure rotation matrix from Euler angles</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>phi</strong> (<em>float</em>) – Z-axis rotation</p></li>
<li><p><strong>theta</strong> (<em>float</em>) – Y-axis rotation</p></li>
<li><p><strong>psi</strong> (<em>float</em>) – Z-axis rotation</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>4x4 homogeneous transformation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpdy.ndarray, shape=(4,4)</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">R</span> <span class="pre">=</span> <span class="pre">eul2tr(PHI,</span> <span class="pre">THETA,</span> <span class="pre">PSI)</span></code> is an SE(3) homogeneous transformation
matrix equivalent to the specified Euler angles.  These correspond
to rotations about the Z, Y, Z axes respectively.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">R</span> <span class="pre">=</span> <span class="pre">eul2tr(EUL)</span></code> as above but the Euler angles are taken from
<code class="docutils literal notranslate"><span class="pre">EUL</span></code> which is a 3-vector (array_like) with values
(PHI THETA PSI).</p></li>
</ul>
<p>Notes:</p>
<ul class="simple">
<li><p>The translational part is zero.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.rpy2tr" title="spatialmath.base.transforms3d.rpy2tr"><code class="xref py py-func docutils literal notranslate"><span class="pre">rpy2tr()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms3d.eul2r" title="spatialmath.base.transforms3d.eul2r"><code class="xref py py-func docutils literal notranslate"><span class="pre">eul2r()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms3d.tr2eul" title="spatialmath.base.transforms3d.tr2eul"><code class="xref py py-func docutils literal notranslate"><span class="pre">tr2eul()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms3d.angvec2r">
<code class="sig-prename descclassname">spatialmath.base.transforms3d.</code><code class="sig-name descname">angvec2r</code><span class="sig-paren">(</span><em class="sig-param">theta</em>, <em class="sig-param">v</em>, <em class="sig-param">unit='rad'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms3d.html#angvec2r"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms3d.angvec2r" title="Permalink to this definition">¶</a></dt>
<dd><p>Create an SO(3) rotation matrix from rotation angle and axis</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>theta</strong> (<em>float</em>) – rotation</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p></li>
<li><p><strong>v</strong> (<em>array_like</em>) – rotation axis, 3-vector</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>3x3 rotation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpdy.ndarray, shape=(3,3)</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">angvec2r(THETA,</span> <span class="pre">V)</span></code> is an SO(3) orthonormal rotation matrix
equivalent to a rotation of <code class="docutils literal notranslate"><span class="pre">THETA</span></code> about the vector <code class="docutils literal notranslate"><span class="pre">V</span></code>.</p>
<p>Notes:</p>
<ul class="simple">
<li><p>If <code class="docutils literal notranslate"><span class="pre">THETA</span> <span class="pre">==</span> <span class="pre">0</span></code> then return identity matrix.</p></li>
<li><p>If <code class="docutils literal notranslate"><span class="pre">THETA</span> <span class="pre">~=</span> <span class="pre">0</span></code> then <code class="docutils literal notranslate"><span class="pre">V</span></code> must have a finite length.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.angvec2tr" title="spatialmath.base.transforms3d.angvec2tr"><code class="xref py py-func docutils literal notranslate"><span class="pre">angvec2tr()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms3d.tr2angvec" title="spatialmath.base.transforms3d.tr2angvec"><code class="xref py py-func docutils literal notranslate"><span class="pre">tr2angvec()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms3d.angvec2tr">
<code class="sig-prename descclassname">spatialmath.base.transforms3d.</code><code class="sig-name descname">angvec2tr</code><span class="sig-paren">(</span><em class="sig-param">theta</em>, <em class="sig-param">v</em>, <em class="sig-param">unit='rad'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms3d.html#angvec2tr"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms3d.angvec2tr" title="Permalink to this definition">¶</a></dt>
<dd><p>Create an SE(3) pure rotation from rotation angle and axis</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>theta</strong> (<em>float</em>) – rotation</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – angular units: ‘rad’ [default], or ‘deg’</p></li>
<li><p><strong>v</strong> (<em>: array_like</em>) – rotation axis, 3-vector</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>4x4 homogeneous transformation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpdy.ndarray, shape=(4,4)</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">angvec2tr(THETA,</span> <span class="pre">V)</span></code> is an SE(3) homogeneous transformation matrix
equivalent to a rotation of <code class="docutils literal notranslate"><span class="pre">THETA</span></code> about the vector <code class="docutils literal notranslate"><span class="pre">V</span></code>.</p>
<p>Notes:</p>
<ul class="simple">
<li><p>If <code class="docutils literal notranslate"><span class="pre">THETA</span> <span class="pre">==</span> <span class="pre">0</span></code> then return identity matrix.</p></li>
<li><p>If <code class="docutils literal notranslate"><span class="pre">THETA</span> <span class="pre">~=</span> <span class="pre">0</span></code> then <code class="docutils literal notranslate"><span class="pre">V</span></code> must have a finite length.</p></li>
<li><p>The translational part is zero.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.angvec2r" title="spatialmath.base.transforms3d.angvec2r"><code class="xref py py-func docutils literal notranslate"><span class="pre">angvec2r()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms3d.tr2angvec" title="spatialmath.base.transforms3d.tr2angvec"><code class="xref py py-func docutils literal notranslate"><span class="pre">tr2angvec()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms3d.oa2r">
<code class="sig-prename descclassname">spatialmath.base.transforms3d.</code><code class="sig-name descname">oa2r</code><span class="sig-paren">(</span><em class="sig-param">o</em>, <em class="sig-param">a=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms3d.html#oa2r"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms3d.oa2r" title="Permalink to this definition">¶</a></dt>
<dd><p>Create SO(3) rotation matrix from two vectors</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>o</strong> (<em>array_like</em>) – 3-vector parallel to Y- axis</p></li>
<li><p><strong>a</strong> – 3-vector parallel to the Z-axis</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>3x3 rotation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(3,3)</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">T</span> <span class="pre">=</span> <span class="pre">oa2tr(O,</span> <span class="pre">A)</span></code> is an SO(3) orthonormal rotation matrix for a frame defined in terms of
vectors parallel to its Y- and Z-axes with respect to a reference frame.  In robotics these axes are
respectively called the orientation and approach vectors defined such that
R = [N O A] and N = O x A.</p>
<p>Steps:</p>
<blockquote>
<div><ol class="arabic simple">
<li><p>N’ = O x A</p></li>
<li><p>O’ = A x N</p></li>
<li><p>normalize N’, O’, A</p></li>
<li><p>stack horizontally into rotation matrix</p></li>
</ol>
</div></blockquote>
<p>Notes:</p>
<ul class="simple">
<li><p>The A vector is the only guaranteed to have the same direction in the resulting
rotation matrix</p></li>
<li><p>O and A do not have to be unit-length, they are normalized</p></li>
<li><p>O and A do not have to be orthogonal, so long as they are not parallel</p></li>
<li><p>The vectors O and A are parallel to the Y- and Z-axes of the equivalent coordinate frame.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.oa2tr" title="spatialmath.base.transforms3d.oa2tr"><code class="xref py py-func docutils literal notranslate"><span class="pre">oa2tr()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms3d.oa2tr">
<code class="sig-prename descclassname">spatialmath.base.transforms3d.</code><code class="sig-name descname">oa2tr</code><span class="sig-paren">(</span><em class="sig-param">o</em>, <em class="sig-param">a=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms3d.html#oa2tr"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms3d.oa2tr" title="Permalink to this definition">¶</a></dt>
<dd><p>Create SE(3) pure rotation from two vectors</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>o</strong> (<em>array_like</em>) – 3-vector parallel to Y- axis</p></li>
<li><p><strong>a</strong> – 3-vector parallel to the Z-axis</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>4x4 homogeneous transformation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(4,4)</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">T</span> <span class="pre">=</span> <span class="pre">oa2tr(O,</span> <span class="pre">A)</span></code> is an SE(3) homogeneous transformation matrix for a frame defined in terms of
vectors parallel to its Y- and Z-axes with respect to a reference frame.  In robotics these axes are
respectively called the orientation and approach vectors defined such that
R = [N O A] and N = O x A.</p>
<p>Steps:</p>
<blockquote>
<div><ol class="arabic simple">
<li><p>N’ = O x A</p></li>
<li><p>O’ = A x N</p></li>
<li><p>normalize N’, O’, A</p></li>
<li><p>stack horizontally into rotation matrix</p></li>
</ol>
</div></blockquote>
<p>Notes:</p>
<ul class="simple">
<li><p>The A vector is the only guaranteed to have the same direction in the resulting
rotation matrix</p></li>
<li><p>O and A do not have to be unit-length, they are normalized</p></li>
<li><p>O and A do not have to be orthogonal, so long as they are not parallel</p></li>
<li><p>The translational part is zero.</p></li>
<li><p>The vectors O and A are parallel to the Y- and Z-axes of the equivalent coordinate frame.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.oa2r" title="spatialmath.base.transforms3d.oa2r"><code class="xref py py-func docutils literal notranslate"><span class="pre">oa2r()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms3d.tr2angvec">
<code class="sig-prename descclassname">spatialmath.base.transforms3d.</code><code class="sig-name descname">tr2angvec</code><span class="sig-paren">(</span><em class="sig-param">T</em>, <em class="sig-param">unit='rad'</em>, <em class="sig-param">check=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms3d.html#tr2angvec"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms3d.tr2angvec" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert SO(3) or SE(3) to angle and rotation vector</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>R</strong> (<em>numpy.ndarray</em><em>, </em><em>shape=</em><em>(</em><em>3</em><em>,</em><em>3</em><em>) or </em><em>(</em><em>4</em><em>,</em><em>4</em><em>)</em>) – SO(3) or SE(3) matrix</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – ‘rad’ or ‘deg’</p></li>
<li><p><strong>check</strong> (<em>bool</em>) – check that rotation matrix is valid</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><span class="math notranslate nohighlight">\((\theta, {\bf v})\)</span></p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>float, numpy.ndarray, shape=(3,)</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">tr2angvec(R)</span></code> is a rotation angle and a vector about which the rotation
acts that corresponds to the rotation part of <code class="docutils literal notranslate"><span class="pre">R</span></code>.</p>
<p>By default the angle is in radians but can be changed setting <cite>unit=’deg’</cite>.</p>
<p>Notes:</p>
<ul class="simple">
<li><p>If the input is SE(3) the translation component is ignored.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.angvec2r" title="spatialmath.base.transforms3d.angvec2r"><code class="xref py py-func docutils literal notranslate"><span class="pre">angvec2r()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms3d.angvec2tr" title="spatialmath.base.transforms3d.angvec2tr"><code class="xref py py-func docutils literal notranslate"><span class="pre">angvec2tr()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms3d.tr2rpy" title="spatialmath.base.transforms3d.tr2rpy"><code class="xref py py-func docutils literal notranslate"><span class="pre">tr2rpy()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms3d.tr2eul" title="spatialmath.base.transforms3d.tr2eul"><code class="xref py py-func docutils literal notranslate"><span class="pre">tr2eul()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms3d.tr2eul">
<code class="sig-prename descclassname">spatialmath.base.transforms3d.</code><code class="sig-name descname">tr2eul</code><span class="sig-paren">(</span><em class="sig-param">T</em>, <em class="sig-param">unit='rad'</em>, <em class="sig-param">flip=False</em>, <em class="sig-param">check=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms3d.html#tr2eul"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms3d.tr2eul" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert SO(3) or SE(3) to ZYX Euler angles</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>R</strong> (<em>numpy.ndarray</em><em>, </em><em>shape=</em><em>(</em><em>3</em><em>,</em><em>3</em><em>) or </em><em>(</em><em>4</em><em>,</em><em>4</em><em>)</em>) – SO(3) or SE(3) matrix</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – ‘rad’ or ‘deg’</p></li>
<li><p><strong>flip</strong> (<em>bool</em>) – choose first Euler angle to be in quadrant 2 or 3</p></li>
<li><p><strong>check</strong> (<em>bool</em>) – check that rotation matrix is valid</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>ZYZ Euler angles</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(3,)</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">tr2eul(R)</span></code> are the Euler angles corresponding to
the rotation part of <code class="docutils literal notranslate"><span class="pre">R</span></code>.</p>
<p>The 3 angles <span class="math notranslate nohighlight">\([\phi, \theta, \psi\)</span> correspond to sequential rotations about the
Z, Y and Z axes respectively.</p>
<p>By default the angles are in radians but can be changed setting <cite>unit=’deg’</cite>.</p>
<p>Notes:</p>
<ul class="simple">
<li><p>There is a singularity for the case where <span class="math notranslate nohighlight">\(\theta=0\)</span> in which case <span class="math notranslate nohighlight">\(\phi\)</span> is arbitrarily set to zero and <span class="math notranslate nohighlight">\(\phi\)</span> is set to <span class="math notranslate nohighlight">\(\phi+\psi\)</span>.</p></li>
<li><p>If the input is SE(3) the translation component is ignored.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.eul2r" title="spatialmath.base.transforms3d.eul2r"><code class="xref py py-func docutils literal notranslate"><span class="pre">eul2r()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms3d.eul2tr" title="spatialmath.base.transforms3d.eul2tr"><code class="xref py py-func docutils literal notranslate"><span class="pre">eul2tr()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms3d.tr2rpy" title="spatialmath.base.transforms3d.tr2rpy"><code class="xref py py-func docutils literal notranslate"><span class="pre">tr2rpy()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms3d.tr2angvec" title="spatialmath.base.transforms3d.tr2angvec"><code class="xref py py-func docutils literal notranslate"><span class="pre">tr2angvec()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms3d.tr2rpy">
<code class="sig-prename descclassname">spatialmath.base.transforms3d.</code><code class="sig-name descname">tr2rpy</code><span class="sig-paren">(</span><em class="sig-param">T</em>, <em class="sig-param">unit='rad'</em>, <em class="sig-param">order='zyx'</em>, <em class="sig-param">check=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms3d.html#tr2rpy"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms3d.tr2rpy" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert SO(3) or SE(3) to roll-pitch-yaw angles</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>R</strong> (<em>numpy.ndarray</em><em>, </em><em>shape=</em><em>(</em><em>3</em><em>,</em><em>3</em><em>) or </em><em>(</em><em>4</em><em>,</em><em>4</em><em>)</em>) – SO(3) or SE(3) matrix</p></li>
<li><p><strong>unit</strong> (<em>str</em>) – ‘rad’ or ‘deg’</p></li>
<li><p><strong>order</strong> – ‘xyz’, ‘zyx’ or ‘yxz’ [default ‘zyx’]</p></li>
<li><p><strong>check</strong> (<em>bool</em>) – check that rotation matrix is valid</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Roll-pitch-yaw angles</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(3,)</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">tr2rpy(R)</span></code> are the roll-pitch-yaw angles corresponding to
the rotation part of <code class="docutils literal notranslate"><span class="pre">R</span></code>.</p>
<p>The 3 angles RPY=[R,P,Y] correspond to sequential rotations about the
Z, Y and X axes respectively.  The axis order sequence can be changed by
setting:</p>
<ul class="simple">
<li><p><cite>order=’xyz’</cite>  for sequential rotations about X, Y, Z axes</p></li>
<li><p><cite>order=’yxz’</cite>  for sequential rotations about Y, X, Z axes</p></li>
</ul>
<p>By default the angles are in radians but can be changed setting <cite>unit=’deg’</cite>.</p>
<p>Notes:</p>
<ul class="simple">
<li><p>There is a singularity for the case where P=:math:<cite>pi/2</cite> in which case R is arbitrarily set to zero and Y is the sum (R+Y).</p></li>
<li><p>If the input is SE(3) the translation component is ignored.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.rpy2r" title="spatialmath.base.transforms3d.rpy2r"><code class="xref py py-func docutils literal notranslate"><span class="pre">rpy2r()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms3d.rpy2tr" title="spatialmath.base.transforms3d.rpy2tr"><code class="xref py py-func docutils literal notranslate"><span class="pre">rpy2tr()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms3d.tr2eul" title="spatialmath.base.transforms3d.tr2eul"><code class="xref py py-func docutils literal notranslate"><span class="pre">tr2eul()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms3d.tr2angvec" title="spatialmath.base.transforms3d.tr2angvec"><code class="xref py py-func docutils literal notranslate"><span class="pre">tr2angvec()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms3d.trlog">
<code class="sig-prename descclassname">spatialmath.base.transforms3d.</code><code class="sig-name descname">trlog</code><span class="sig-paren">(</span><em class="sig-param">T</em>, <em class="sig-param">check=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms3d.html#trlog"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms3d.trlog" title="Permalink to this definition">¶</a></dt>
<dd><p>Logarithm of SO(3) or SE(3) matrix</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>T</strong> (<em>numpy.ndarray</em><em>, </em><em>shape=</em><em>(</em><em>3</em><em>,</em><em>3</em><em>) or </em><em>(</em><em>4</em><em>,</em><em>4</em><em>)</em>) – SO(3) or SE(3) matrix</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>logarithm</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(3,3) or (4,4)</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>ValueError</p>
</dd>
</dl>
<p>An efficient closed-form solution of the matrix logarithm for arguments that are SO(3) or SE(3).</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">trlog(R)</span></code> is the logarithm of the passed rotation matrix <code class="docutils literal notranslate"><span class="pre">R</span></code> which will be
3x3 skew-symmetric matrix.  The equivalent vector from <code class="docutils literal notranslate"><span class="pre">vex()</span></code> is parallel to rotation axis
and its norm is the amount of rotation about that axis.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">trlog(T)</span></code> is the logarithm of the passed homogeneous transformation matrix <code class="docutils literal notranslate"><span class="pre">T</span></code> which will be
4x4 augumented skew-symmetric matrix. The equivalent vector from <code class="docutils literal notranslate"><span class="pre">vexa()</span></code> is the twist
vector (6x1) comprising [v w].</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.trexp" title="spatialmath.base.transforms3d.trexp"><code class="xref py py-func docutils literal notranslate"><span class="pre">trexp()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transformsNd.vex" title="spatialmath.base.transformsNd.vex"><code class="xref py py-func docutils literal notranslate"><span class="pre">vex()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transformsNd.vexa" title="spatialmath.base.transformsNd.vexa"><code class="xref py py-func docutils literal notranslate"><span class="pre">vexa()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms3d.trexp">
<code class="sig-prename descclassname">spatialmath.base.transforms3d.</code><code class="sig-name descname">trexp</code><span class="sig-paren">(</span><em class="sig-param">S</em>, <em class="sig-param">theta=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms3d.html#trexp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms3d.trexp" title="Permalink to this definition">¶</a></dt>
<dd><p>Exponential of so(3) or se(3) matrix</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>S</strong> – so(3), se(3) matrix or equivalent velctor</p></li>
<li><p><strong>theta</strong> (<em>float</em>) – motion</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>3x3 or 4x4 matrix exponential in SO(3) or SE(3)</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(3,3) or (4,4)</p>
</dd>
</dl>
<p>An efficient closed-form solution of the matrix exponential for arguments
that are so(3) or se(3).</p>
<p>For so(3) the results is an SO(3) rotation matrix:</p>
<ul class="simple">
<li><dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">trexp(S)</span></code> is the matrix exponential of the so(3) element <code class="docutils literal notranslate"><span class="pre">S</span></code> which is a 3x3</dt><dd><p>skew-symmetric matrix.</p>
</dd>
</dl>
</li>
<li><p><code class="docutils literal notranslate"><span class="pre">trexp(S,</span> <span class="pre">THETA)</span></code> as above but for an so(3) motion of S*THETA, where <code class="docutils literal notranslate"><span class="pre">S</span></code> is
unit-norm skew-symmetric matrix representing a rotation axis and a rotation magnitude
given by <code class="docutils literal notranslate"><span class="pre">THETA</span></code>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">trexp(W)</span></code> is the matrix exponential of the so(3) element <code class="docutils literal notranslate"><span class="pre">W</span></code> expressed as
a 3-vector (array_like).</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">trexp(W,</span> <span class="pre">THETA)</span></code> as above but for an so(3) motion of W*THETA where <code class="docutils literal notranslate"><span class="pre">W</span></code> is a
unit-norm vector representing a rotation axis and a rotation magnitude
given by <code class="docutils literal notranslate"><span class="pre">THETA</span></code>. <code class="docutils literal notranslate"><span class="pre">W</span></code> is expressed as a 3-vector (array_like).</p></li>
</ul>
<p>For se(3) the results is an SE(3) homogeneous transformation matrix:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">trexp(SIGMA)</span></code> is the matrix exponential of the se(3) element <code class="docutils literal notranslate"><span class="pre">SIGMA</span></code> which is
a 4x4 augmented skew-symmetric matrix.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">trexp(SIGMA,</span> <span class="pre">THETA)</span></code> as above but for an se(3) motion of SIGMA*THETA, where <code class="docutils literal notranslate"><span class="pre">SIGMA</span></code>
must represent a unit-twist, ie. the rotational component is a unit-norm skew-symmetric
matrix.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">trexp(TW)</span></code> is the matrix exponential of the se(3) element <code class="docutils literal notranslate"><span class="pre">TW</span></code> represented as
a 6-vector which can be considered a screw motion.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">trexp(TW,</span> <span class="pre">THETA)</span></code> as above but for an se(3) motion of TW*THETA, where <code class="docutils literal notranslate"><span class="pre">TW</span></code>
must represent a unit-twist, ie. the rotational component is a unit-norm skew-symmetric
matrix.</p></li>
</ul>
<blockquote>
<div><dl class="field-list simple">
<dt class="field-odd">seealso</dt>
<dd class="field-odd"><p><code class="xref py py-func docutils literal notranslate"><span class="pre">trexp2()</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms3d.trnorm">
<code class="sig-prename descclassname">spatialmath.base.transforms3d.</code><code class="sig-name descname">trnorm</code><span class="sig-paren">(</span><em class="sig-param">T</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms3d.html#trnorm"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms3d.trnorm" title="Permalink to this definition">¶</a></dt>
<dd><p>Normalize an SO(3) or SE(3) matrix</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>T</strong> – SO(3) or SE(3) matrix</p></li>
<li><p><strong>T1</strong> (<em>np.ndarray</em><em>, </em><em>shape=</em><em>(</em><em>3</em><em>,</em><em>3</em><em>) or </em><em>(</em><em>4</em><em>,</em><em>4</em><em>)</em>) – second SE(3) matrix</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>SO(3) or SE(3) matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>np.ndarray, shape=(3,3) or (4,4)</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">trnorm(R)</span></code> is guaranteed to be a proper orthogonal matrix rotation
matrix (3x3) which is “close” to the input matrix R (3x3). If R
= [N,O,A] the O and A vectors are made unit length and the normal vector
is formed from N = O x A, and then we ensure that O and A are orthogonal
by O = A x N.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">trnorm(T)</span></code> as above but the rotational submatrix of the homogeneous
transformation T (4x4) is normalised while the translational part is
unchanged.</p></li>
</ul>
<p>Notes:</p>
<ul class="simple">
<li><p>Only the direction of A (the z-axis) is unchanged.</p></li>
<li><p>Used to prevent finite word length arithmetic causing transforms to 
become ‘unnormalized’.</p></li>
</ul>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms3d.trinterp">
<code class="sig-prename descclassname">spatialmath.base.transforms3d.</code><code class="sig-name descname">trinterp</code><span class="sig-paren">(</span><em class="sig-param">T0</em>, <em class="sig-param">T1=None</em>, <em class="sig-param">s=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms3d.html#trinterp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms3d.trinterp" title="Permalink to this definition">¶</a></dt>
<dd><p>Interpolate SE(3) matrices</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>T0</strong> (<em>np.ndarray</em><em>, </em><em>shape=</em><em>(</em><em>4</em><em>,</em><em>4</em><em>)</em>) – first SE(3) matrix</p></li>
<li><p><strong>T1</strong> (<em>np.ndarray</em><em>, </em><em>shape=</em><em>(</em><em>4</em><em>,</em><em>4</em><em>)</em>) – second SE(3) matrix</p></li>
<li><p><strong>s</strong> (<em>float</em>) – interpolation coefficient, range 0 to 1</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>SE(3) matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>np.ndarray, shape=(4,4)</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">trinterp(T0,</span> <span class="pre">T1,</span> <span class="pre">S)</span></code> is a homogeneous transform (4x4) interpolated
between T0 when S=0 and T1 when S=1.  T0 and T1 are both homogeneous
transforms (4x4).</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">trinterp(T1,</span> <span class="pre">S)</span></code> as above but interpolated between the identity matrix
when S=0 to T1 when S=1.</p></li>
</ul>
<p>Notes:</p>
<ul class="simple">
<li><p>Rotation is interpolated using quaternion spherical linear interpolation (slerp).</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.quaternions.slerp" title="spatialmath.base.quaternions.slerp"><code class="xref py py-func docutils literal notranslate"><span class="pre">spatialmath.base.quaternions.slerp()</span></code></a>, <code class="xref py py-func docutils literal notranslate"><span class="pre">trinterp2()</span></code></p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms3d.delta2tr">
<code class="sig-prename descclassname">spatialmath.base.transforms3d.</code><code class="sig-name descname">delta2tr</code><span class="sig-paren">(</span><em class="sig-param">d</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms3d.html#delta2tr"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms3d.delta2tr" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert differential motion to SE(3)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>d</strong> (<em>array_like</em>) – differential motion as a 6-vector</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>SE(3) matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>np.ndarray, shape=(4,4)</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">T</span> <span class="pre">=</span> <span class="pre">delta2tr(d)</span></code> is an SE(3) matrix representing differential 
motion <span class="math notranslate nohighlight">\(d = [\delta_x, \delta_y, \delta_z, \theta_x, \theta_y, \theta_z\)</span>.</p>
<p>Reference: Robotics, Vision &amp; Control: Second Edition, P. Corke, Springer 2016; p67.</p>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.tr2delta" title="spatialmath.base.transforms3d.tr2delta"><code class="xref py py-func docutils literal notranslate"><span class="pre">tr2delta()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms3d.trinv">
<code class="sig-prename descclassname">spatialmath.base.transforms3d.</code><code class="sig-name descname">trinv</code><span class="sig-paren">(</span><em class="sig-param">T</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms3d.html#trinv"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms3d.trinv" title="Permalink to this definition">¶</a></dt>
<dd><p>Invert an SE(3) matrix</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>T</strong> (<em>np.ndarray</em><em>, </em><em>shape=</em><em>(</em><em>4</em><em>,</em><em>4</em><em>)</em>) – an SE(3) matrix</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>SE(3) matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>np.ndarray, shape=(4,4)</p>
</dd>
</dl>
<p>Computes an efficient inverse of an SE(3) matrix:</p>
<p><span class="math notranslate nohighlight">\(\begin{pmatrix} {\bf R} &amp; t \\ 0\,0\,0 &amp; 1 \end{pmatrix}^{-1} =  \begin{pmatrix} {\bf R}^T &amp; -{\bf R}^T t \\ 0\,0\, 0 &amp; 1 \end{pmatrix}\)</span></p>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms3d.tr2delta">
<code class="sig-prename descclassname">spatialmath.base.transforms3d.</code><code class="sig-name descname">tr2delta</code><span class="sig-paren">(</span><em class="sig-param">T0</em>, <em class="sig-param">T1=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms3d.html#tr2delta"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms3d.tr2delta" title="Permalink to this definition">¶</a></dt>
<dd><p>Difference of SE(3) matrices as differential motion</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>T0</strong> (<em>np.ndarray</em><em>, </em><em>shape=</em><em>(</em><em>4</em><em>,</em><em>4</em><em>)</em>) – first SE(3) matrix</p></li>
<li><p><strong>T1</strong> (<em>np.ndarray</em><em>, </em><em>shape=</em><em>(</em><em>4</em><em>,</em><em>4</em><em>)</em>) – second SE(3) matrix</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Sdifferential motion as a 6-vector</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>np.ndarray, shape=(6,)</p>
</dd>
</dl>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">tr2delta(T0,</span> <span class="pre">T1)</span></code> is the differential motion (6x1) corresponding to 
infinitessimal motion (in the T0 frame) from pose T0 to T1 which are SE(3) matrices.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">tr2delta(T)</span></code> as above but the motion is from the world frame to the pose represented by T.</p></li>
</ul>
<p>The vector <span class="math notranslate nohighlight">\(d = [\delta_x, \delta_y, \delta_z,        heta_x,         heta_y,         heta_z\)</span>
represents infinitessimal translation and rotation, and is an approximation to the 
instantaneous spatial velocity multiplied by time step.</p>
<p>Notes:</p>
<ul class="simple">
<li><p>D is only an approximation to the motion T, and assumes
that T0 ~ T1 or T ~ eye(4,4).</p></li>
<li><p>Can be considered as an approximation to the effect of spatial velocity over a
a time interval, average spatial velocity multiplied by time.</p></li>
</ul>
<p>Reference: Robotics, Vision &amp; Control: Second Edition, P. Corke, Springer 2016; p67.</p>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms3d.delta2tr" title="spatialmath.base.transforms3d.delta2tr"><code class="xref py py-func docutils literal notranslate"><span class="pre">delta2tr()</span></code></a></p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms3d.tr2jac">
<code class="sig-prename descclassname">spatialmath.base.transforms3d.</code><code class="sig-name descname">tr2jac</code><span class="sig-paren">(</span><em class="sig-param">T</em>, <em class="sig-param">samebody=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms3d.html#tr2jac"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms3d.tr2jac" title="Permalink to this definition">¶</a></dt>
<dd><p>SE(3) adjoint</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>T</strong> (<em>np.ndarray</em><em>, </em><em>shape=</em><em>(</em><em>4</em><em>,</em><em>4</em><em>)</em>) – an SE(3) matrix</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>adjoint matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>np.ndarray, shape=(6,6)</p>
</dd>
</dl>
<p>Computes an adjoint matrix that maps spatial velocity between two frames defined by
an SE(3) matrix.  It acts like a Jacobian matrix.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">tr2jac(T)</span></code> is a Jacobian matrix (6x6) that maps spatial velocity or
differential motion from frame {A} to frame {B} where the pose of {B}
relative to {A} is represented by the homogeneous transform T = <span class="math notranslate nohighlight">\({}^A {f T}_B\)</span>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">tr2jac(T,</span> <span class="pre">True)</span></code> as above but for the case when frame {A} to frame {B} are both
attached to the same moving body.</p></li>
</ul>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms3d.trprint">
<code class="sig-prename descclassname">spatialmath.base.transforms3d.</code><code class="sig-name descname">trprint</code><span class="sig-paren">(</span><em class="sig-param">T</em>, <em class="sig-param">orient='rpy/zyx'</em>, <em class="sig-param">label=None</em>, <em class="sig-param">file=&lt;_io.TextIOWrapper name='&lt;stdout&gt;' mode='w' encoding='UTF-8'&gt;</em>, <em class="sig-param">fmt='{:8.2g}'</em>, <em class="sig-param">unit='deg'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms3d.html#trprint"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms3d.trprint" title="Permalink to this definition">¶</a></dt>
<dd><blockquote>
<div><p>Compact display of SO(3) or SE(3) matrices</p>
<dl class="field-list simple">
<dt class="field-odd">param T</dt>
<dd class="field-odd"><p>matrix to format</p>
</dd>
<dt class="field-even">type T</dt>
<dd class="field-even"><p>numpy.ndarray, shape=(3,3) or (4,4)</p>
</dd>
<dt class="field-odd">param label</dt>
<dd class="field-odd"><p>text label to put at start of line</p>
</dd>
<dt class="field-even">type label</dt>
<dd class="field-even"><p>str</p>
</dd>
<dt class="field-odd">param orient</dt>
<dd class="field-odd"><p>3-angle convention to use</p>
</dd>
<dt class="field-even">type orient</dt>
<dd class="field-even"><p>str</p>
</dd>
<dt class="field-odd">param file</dt>
<dd class="field-odd"><p>file to write formatted string to. [default, stdout]</p>
</dd>
<dt class="field-even">type file</dt>
<dd class="field-even"><p>str</p>
</dd>
<dt class="field-odd">param fmt</dt>
<dd class="field-odd"><p>conversion format for each number</p>
</dd>
<dt class="field-even">type fmt</dt>
<dd class="field-even"><p>str</p>
</dd>
<dt class="field-odd">param unit</dt>
<dd class="field-odd"><p>angular units: ‘rad’ [default], or ‘deg’</p>
</dd>
<dt class="field-even">type unit</dt>
<dd class="field-even"><p>str</p>
</dd>
<dt class="field-odd">return</dt>
<dd class="field-odd"><p>optional formatted string</p>
</dd>
<dt class="field-even">rtype</dt>
<dd class="field-even"><p>str</p>
</dd>
</dl>
<p>The matrix is formatted and written to <code class="docutils literal notranslate"><span class="pre">file</span></code> or if <code class="docutils literal notranslate"><span class="pre">file=None</span></code> then the
string is returned.</p>
</div></blockquote>
<ul>
<li><dl>
<dt><code class="docutils literal notranslate"><span class="pre">trprint(R)</span></code> displays the SO(3) rotation matrix in a compact</dt><dd><p>single-line format:</p>
<blockquote>
<div><p>[LABEL:] ORIENTATION UNIT</p>
</div></blockquote>
</dd>
</dl>
</li>
</ul>
<blockquote>
<div><ul>
<li><p><code class="docutils literal notranslate"><span class="pre">trprint(T)</span></code> displays the SE(3) homogoneous transform in a compact
single-line format:</p>
<blockquote>
<div><p>[LABEL:] [t=X, Y, Z;] ORIENTATION UNIT</p>
</div></blockquote>
</li>
</ul>
<p>Orientation is expressed in one of several formats:</p>
<ul class="simple">
<li><p>‘rpy/zyx’ roll-pitch-yaw angles in ZYX axis order [default]</p></li>
<li><p>‘rpy/yxz’ roll-pitch-yaw angles in YXZ axis order</p></li>
<li><p>‘rpy/zyx’ roll-pitch-yaw angles in ZYX axis order</p></li>
<li><p>‘eul’ Euler angles in ZYZ axis order</p></li>
<li><p>‘angvec’ angle and axis</p></li>
</ul>
<p>Example:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">T</span> <span class="o">=</span> <span class="n">transl</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">3</span><span class="p">)</span> <span class="o">@</span> <span class="n">rpy2tr</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span> <span class="mi">20</span><span class="p">,</span> <span class="mi">30</span><span class="p">,</span> <span class="s1">&#39;deg&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">trprint</span><span class="p">(</span><span class="n">T</span><span class="p">,</span> <span class="n">file</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s1">&#39;T&#39;</span><span class="p">)</span>
<span class="go">&#39;T: t =        1,        2,        3; rpy/zyx =       10,       20,       30 deg&#39;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">trprint</span><span class="p">(</span><span class="n">T</span><span class="p">,</span> <span class="n">file</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s1">&#39;T&#39;</span><span class="p">,</span> <span class="n">orient</span><span class="o">=</span><span class="s1">&#39;angvec&#39;</span><span class="p">)</span>
<span class="go">&#39;T: t =        1,        2,        3; angvec = (      56 deg |     0.12,     0.62,     0.78)&#39;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">trprint</span><span class="p">(</span><span class="n">T</span><span class="p">,</span> <span class="n">file</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="s1">&#39;T&#39;</span><span class="p">,</span> <span class="n">orient</span><span class="o">=</span><span class="s1">&#39;angvec&#39;</span><span class="p">,</span> <span class="n">fmt</span><span class="o">=</span><span class="s1">&#39;</span><span class="si">{:8.4g}</span><span class="s1">&#39;</span><span class="p">)</span>
<span class="go">&#39;T: t =        1,        2,        3; angvec = (   56.04 deg |    0.124,   0.6156,   0.7782)&#39;</span>
</pre></div>
</div>
<p>Notes:</p>
<blockquote>
<div><ul class="simple">
<li><p>If the ‘rpy’ option is selected, then the particular angle sequence can be
specified with the options ‘xyz’ or ‘yxz’ which are passed through to <code class="docutils literal notranslate"><span class="pre">tr2rpy</span></code>.
‘zyx’ is the default.</p></li>
<li><p>Default formatting is for readable columns of data</p></li>
</ul>
</div></blockquote>
<dl class="field-list simple">
<dt class="field-odd">seealso</dt>
<dd class="field-odd"><p><a class="reference internal" href="#spatialmath.base.transforms2d.trprint2" title="spatialmath.base.transforms2d.trprint2"><code class="xref py py-func docutils literal notranslate"><span class="pre">trprint2()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms3d.tr2eul" title="spatialmath.base.transforms3d.tr2eul"><code class="xref py py-func docutils literal notranslate"><span class="pre">tr2eul()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms3d.tr2rpy" title="spatialmath.base.transforms3d.tr2rpy"><code class="xref py py-func docutils literal notranslate"><span class="pre">tr2rpy()</span></code></a>, <a class="reference internal" href="#spatialmath.base.transforms3d.tr2angvec" title="spatialmath.base.transforms3d.tr2angvec"><code class="xref py py-func docutils literal notranslate"><span class="pre">tr2angvec()</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms3d.trplot">
<code class="sig-prename descclassname">spatialmath.base.transforms3d.</code><code class="sig-name descname">trplot</code><span class="sig-paren">(</span><em class="sig-param">T, axes=None, dims=None, color='blue', frame=None, textcolor=None, labels=['X', 'Y', 'Z'], length=1, arrow=True, projection='ortho', rviz=False, wtl=0.2, width=1, d1=0.05, d2=1.15, **kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms3d.html#trplot"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms3d.trplot" title="Permalink to this definition">¶</a></dt>
<dd><p>Plot a 3D coordinate frame</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>T</strong> – an SO(3) or SE(3) pose to be displayed as coordinate frame</p></li>
<li><p><strong>axes</strong> (<em>Axes3D reference</em>) – the axes to plot into, defaults to current axes</p></li>
<li><p><strong>dims</strong> (<em>array_like</em>) – dimension of plot volume as [xmin, xmax, ymin, ymax,zmin, zmax].
If dims is [min, max] those limits are applied to the x-, y- and z-axes.</p></li>
<li><p><strong>color</strong> (<em>str</em>) – color of the lines defining the frame</p></li>
<li><p><strong>textcolor</strong> (<em>str</em>) – color of text labels for the frame, default color of lines above</p></li>
<li><p><strong>frame</strong> (<em>str</em>) – label the frame, name is shown below the frame and as subscripts on the frame axis labels</p></li>
<li><p><strong>labels</strong> (<em>3-tuple of strings</em>) – labels for the axes, defaults to X, Y and Z</p></li>
<li><p><strong>length</strong> (<em>float</em>) – length of coordinate frame axes, default 1</p></li>
<li><p><strong>arrow</strong> (<em>bool</em>) – show arrow heads, default True</p></li>
<li><p><strong>wtl</strong> (<em>float</em>) – width-to-length ratio for arrows, default 0.2</p></li>
<li><p><strong>rviz</strong> (<em>bool</em>) – show Rviz style arrows, default False</p></li>
<li><p><strong>projection</strong> (<em>str</em>) – 3D projection: ortho [default] or persp</p></li>
<li><p><strong>width</strong> (<em>float</em>) – width of lines, default 1</p></li>
<li><p><strong>d1</strong> – distance of frame axis label text from origin, default 1.15</p></li>
</ul>
</dd>
<dt class="field-even">Type</dt>
<dd class="field-even"><p>numpy.ndarray, shape=(3,3) or (4,4)</p>
</dd>
</dl>
<p>Adds a 3D coordinate frame represented by the SO(3) or SE(3) matrix to the current axes.</p>
<ul class="simple">
<li><p>If no current figure, one is created</p></li>
<li><p>If current figure, but no axes, a 3d Axes is created</p></li>
</ul>
<p>Examples:</p>
<blockquote>
<div><p>trplot(T, frame=’A’)
trplot(T, frame=’A’, color=’green’)
trplot(T1, ‘labels’, ‘NOA’);</p>
</div></blockquote>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transforms3d.tranimate">
<code class="sig-prename descclassname">spatialmath.base.transforms3d.</code><code class="sig-name descname">tranimate</code><span class="sig-paren">(</span><em class="sig-param">T</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transforms3d.html#tranimate"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transforms3d.tranimate" title="Permalink to this definition">¶</a></dt>
<dd><p>Animate a 3D coordinate frame</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>T</strong> – an SO(3) or SE(3) pose to be displayed as coordinate frame</p></li>
<li><p><strong>nframes</strong> (<em>int</em>) – number of steps in the animation [defaault 100]</p></li>
<li><p><strong>repeat</strong> (<em>bool</em>) – animate in endless loop [default False]</p></li>
<li><p><strong>interval</strong> (<em>int</em>) – number of milliseconds between frames [default 50]</p></li>
<li><p><strong>movie</strong> (<em>str</em>) – name of file to write MP4 movie into</p></li>
</ul>
</dd>
<dt class="field-even">Type</dt>
<dd class="field-even"><p>numpy.ndarray, shape=(3,3) or (4,4)</p>
</dd>
</dl>
<p>Animates a 3D coordinate frame moving from the world frame to a frame represented by the SO(3) or SE(3) matrix to the current axes.</p>
<ul class="simple">
<li><p>If no current figure, one is created</p></li>
<li><p>If current figure, but no axes, a 3d Axes is created</p></li>
</ul>
<p>Examples:</p>
<blockquote>
<div><p>tranimate(transl(1,2,3)&#64;trotx(1), frame=’A’, arrow=False, dims=[0, 5])
tranimate(transl(1,2,3)&#64;trotx(1), frame=’A’, arrow=False, dims=[0, 5], movie=’spin.mp4’)</p>
</div></blockquote>
</dd></dl>

</div>
<div class="section" id="module-spatialmath.base.transformsNd">
<span id="transforms-in-nd"></span><h3>Transforms in ND<a class="headerlink" href="#module-spatialmath.base.transformsNd" title="Permalink to this headline">¶</a></h3>
<p>This modules contains functions to create and transform rotation matrices
and homogeneous tranformation matrices.</p>
<p>Vector arguments are what numpy refers to as <code class="docutils literal notranslate"><span class="pre">array_like</span></code> and can be a list,
tuple, numpy array, numpy row vector or numpy column vector.</p>
<p>Versions:</p>
<blockquote>
<div><ol class="arabic simple">
<li><p>Luis Fernando Lara Tobar and Peter Corke, 2008</p></li>
<li><p>Josh Carrigg Hodson, Aditya Dua, Chee Ho Chan, 2017</p></li>
<li><p>Peter Corke, 2020</p></li>
</ol>
</div></blockquote>
<dl class="function">
<dt id="spatialmath.base.transformsNd.r2t">
<code class="sig-prename descclassname">spatialmath.base.transformsNd.</code><code class="sig-name descname">r2t</code><span class="sig-paren">(</span><em class="sig-param">R</em>, <em class="sig-param">check=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transformsNd.html#r2t"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transformsNd.r2t" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert SO(n) to SE(n)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>R</strong> – rotation matrix</p></li>
<li><p><strong>check</strong> – check if rotation matrix is valid (default False, no check)</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>homogeneous transformation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(3,3) or (4,4)</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">T</span> <span class="pre">=</span> <span class="pre">r2t(R)</span></code> is an SE(2) or SE(3) homogeneous transform equivalent to an
SO(2) or SO(3) orthonormal rotation matrix <code class="docutils literal notranslate"><span class="pre">R</span></code> with a zero translational
component</p>
<ul class="simple">
<li><p>if <code class="docutils literal notranslate"><span class="pre">R</span></code> is 2x2 then <code class="docutils literal notranslate"><span class="pre">T</span></code> is 3x3: SO(2) -&gt; SE(2)</p></li>
<li><p>if <code class="docutils literal notranslate"><span class="pre">R</span></code> is 3x3 then <code class="docutils literal notranslate"><span class="pre">T</span></code> is 4x4: SO(3) -&gt; SE(3)</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>t2r, rt2tr</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transformsNd.t2r">
<code class="sig-prename descclassname">spatialmath.base.transformsNd.</code><code class="sig-name descname">t2r</code><span class="sig-paren">(</span><em class="sig-param">T</em>, <em class="sig-param">check=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transformsNd.html#t2r"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transformsNd.t2r" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert SE(n) to SO(n)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>T</strong> – homogeneous transformation matrix</p></li>
<li><p><strong>check</strong> – check if rotation matrix is valid (default False, no check)</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>rotation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(2,2) or (3,3)</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">R</span> <span class="pre">=</span> <span class="pre">T2R(T)</span></code> is the orthonormal rotation matrix component of homogeneous
transformation matrix <code class="docutils literal notranslate"><span class="pre">T</span></code></p>
<ul class="simple">
<li><p>if <code class="docutils literal notranslate"><span class="pre">T</span></code> is 3x3 then <code class="docutils literal notranslate"><span class="pre">R</span></code> is 2x2: SE(2) -&gt; SO(2)</p></li>
<li><p>if <code class="docutils literal notranslate"><span class="pre">T</span></code> is 4x4 then <code class="docutils literal notranslate"><span class="pre">R</span></code> is 3x3: SE(3) -&gt; SO(3)</p></li>
</ul>
<p>Any translational component of T is lost.</p>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>r2t, tr2rt</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transformsNd.tr2rt">
<code class="sig-prename descclassname">spatialmath.base.transformsNd.</code><code class="sig-name descname">tr2rt</code><span class="sig-paren">(</span><em class="sig-param">T</em>, <em class="sig-param">check=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transformsNd.html#tr2rt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transformsNd.tr2rt" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert SE(3) to SO(3) and translation</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>T</strong> – homogeneous transform matrix</p></li>
<li><p><strong>check</strong> – check if rotation matrix is valid (default False, no check)</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Rotation matrix and translation vector</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>tuple: numpy.ndarray, shape=(2,2) or (3,3); numpy.ndarray, shape=(2,) or (3,)</p>
</dd>
</dl>
<p>(R,t) = tr2rt(T) splits a homogeneous transformation matrix (NxN) into an orthonormal
rotation matrix R (MxM) and a translation vector T (Mx1), where N=M+1.</p>
<ul class="simple">
<li><p>if <code class="docutils literal notranslate"><span class="pre">T</span></code> is 3x3 - in SE(2) - then <code class="docutils literal notranslate"><span class="pre">R</span></code> is 2x2 and <code class="docutils literal notranslate"><span class="pre">t</span></code> is 2x1.</p></li>
<li><p>if <code class="docutils literal notranslate"><span class="pre">T</span></code> is 4x4 - in SE(3) - then <code class="docutils literal notranslate"><span class="pre">R</span></code> is 3x3 and <code class="docutils literal notranslate"><span class="pre">t</span></code> is 3x1.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>rt2tr, tr2r</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transformsNd.rt2tr">
<code class="sig-prename descclassname">spatialmath.base.transformsNd.</code><code class="sig-name descname">rt2tr</code><span class="sig-paren">(</span><em class="sig-param">R</em>, <em class="sig-param">t</em>, <em class="sig-param">check=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transformsNd.html#rt2tr"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transformsNd.rt2tr" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert SO(3) and translation to SE(3)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>R</strong> – rotation matrix</p></li>
<li><p><strong>t</strong> – translation vector</p></li>
<li><p><strong>check</strong> – check if rotation matrix is valid (default False, no check)</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>homogeneous transform</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(3,3) or (4,4)</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">T</span> <span class="pre">=</span> <span class="pre">rt2tr(R,</span> <span class="pre">t)</span></code> is a homogeneous transformation matrix (N+1xN+1) formed from an
orthonormal rotation matrix <code class="docutils literal notranslate"><span class="pre">R</span></code> (NxN) and a translation vector <code class="docutils literal notranslate"><span class="pre">t</span></code>
(Nx1).</p>
<ul class="simple">
<li><p>If <code class="docutils literal notranslate"><span class="pre">R</span></code> is 2x2 and <code class="docutils literal notranslate"><span class="pre">t</span></code> is 2x1, then <code class="docutils literal notranslate"><span class="pre">T</span></code> is 3x3</p></li>
<li><p>If <code class="docutils literal notranslate"><span class="pre">R</span></code> is 3x3 and <code class="docutils literal notranslate"><span class="pre">t</span></code> is 3x1, then <code class="docutils literal notranslate"><span class="pre">T</span></code> is 4x4</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>rt2m, tr2rt, r2t</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transformsNd.rt2m">
<code class="sig-prename descclassname">spatialmath.base.transformsNd.</code><code class="sig-name descname">rt2m</code><span class="sig-paren">(</span><em class="sig-param">R</em>, <em class="sig-param">t</em>, <em class="sig-param">check=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transformsNd.html#rt2m"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transformsNd.rt2m" title="Permalink to this definition">¶</a></dt>
<dd><p>Pack rotation and translation to matrix</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>R</strong> – rotation matrix</p></li>
<li><p><strong>t</strong> – translation vector</p></li>
<li><p><strong>check</strong> – check if rotation matrix is valid (default False, no check)</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>homogeneous transform</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(3,3) or (4,4)</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">T</span> <span class="pre">=</span> <span class="pre">rt2m(R,</span> <span class="pre">t)</span></code> is a matrix (N+1xN+1) formed from a matrix <code class="docutils literal notranslate"><span class="pre">R</span></code> (NxN) and a vector <code class="docutils literal notranslate"><span class="pre">t</span></code>
(Nx1).  The bottom row is all zeros.</p>
<ul class="simple">
<li><p>If <code class="docutils literal notranslate"><span class="pre">R</span></code> is 2x2 and <code class="docutils literal notranslate"><span class="pre">t</span></code> is 2x1, then <code class="docutils literal notranslate"><span class="pre">T</span></code> is 3x3</p></li>
<li><p>If <code class="docutils literal notranslate"><span class="pre">R</span></code> is 3x3 and <code class="docutils literal notranslate"><span class="pre">t</span></code> is 3x1, then <code class="docutils literal notranslate"><span class="pre">T</span></code> is 4x4</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>rt2tr, tr2rt, r2t</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transformsNd.isR">
<code class="sig-prename descclassname">spatialmath.base.transformsNd.</code><code class="sig-name descname">isR</code><span class="sig-paren">(</span><em class="sig-param">R</em>, <em class="sig-param">tol=100</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transformsNd.html#isR"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transformsNd.isR" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if matrix belongs to SO(n)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>R</strong> (<em>numpy.ndarray</em>) – matrix to test</p></li>
<li><p><strong>tol</strong> (<em>float</em>) – tolerance in units of eps</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>whether matrix is a proper orthonormal rotation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
<p>Checks orthogonality, ie. <span class="math notranslate nohighlight">\({\bf R} {\bf R}^T = {\bf I}\)</span> and <span class="math notranslate nohighlight">\(\det({\bf R}) &gt; 0\)</span>.
For the first test we check that the norm of the residual is less than <code class="docutils literal notranslate"><span class="pre">tol</span> <span class="pre">*</span> <span class="pre">eps</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>isrot2, isrot</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transformsNd.isskew">
<code class="sig-prename descclassname">spatialmath.base.transformsNd.</code><code class="sig-name descname">isskew</code><span class="sig-paren">(</span><em class="sig-param">S</em>, <em class="sig-param">tol=10</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transformsNd.html#isskew"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transformsNd.isskew" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if matrix belongs to so(n)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>S</strong> (<em>numpy.ndarray</em>) – matrix to test</p></li>
<li><p><strong>tol</strong> (<em>float</em>) – tolerance in units of eps</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>whether matrix is a proper skew-symmetric matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
<p>Checks skew-symmetry, ie. <span class="math notranslate nohighlight">\({\bf S} + {\bf S}^T = {\bf 0}\)</span>.
We check that the norm of the residual is less than <code class="docutils literal notranslate"><span class="pre">tol</span> <span class="pre">*</span> <span class="pre">eps</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>isskewa</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transformsNd.isskewa">
<code class="sig-prename descclassname">spatialmath.base.transformsNd.</code><code class="sig-name descname">isskewa</code><span class="sig-paren">(</span><em class="sig-param">S</em>, <em class="sig-param">tol=10</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transformsNd.html#isskewa"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transformsNd.isskewa" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if matrix belongs to se(n)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>S</strong> (<em>numpy.ndarray</em>) – matrix to test</p></li>
<li><p><strong>tol</strong> (<em>float</em>) – tolerance in units of eps</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>whether matrix is a proper skew-symmetric matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
<p>Check if matrix is augmented skew-symmetric, ie. the top left (n-1xn-1) partition <code class="docutils literal notranslate"><span class="pre">S</span></code> is
skew-symmetric <span class="math notranslate nohighlight">\({\bf S} + {\bf S}^T = {\bf 0}\)</span>, and the bottom row is zero
We check that the norm of the residual is less than <code class="docutils literal notranslate"><span class="pre">tol</span> <span class="pre">*</span> <span class="pre">eps</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>isskew</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transformsNd.iseye">
<code class="sig-prename descclassname">spatialmath.base.transformsNd.</code><code class="sig-name descname">iseye</code><span class="sig-paren">(</span><em class="sig-param">S</em>, <em class="sig-param">tol=10</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transformsNd.html#iseye"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transformsNd.iseye" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if matrix is identity</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>S</strong> (<em>numpy.ndarray</em>) – matrix to test</p></li>
<li><p><strong>tol</strong> (<em>float</em>) – tolerance in units of eps</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>whether matrix is a proper skew-symmetric matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
<p>Check if matrix is an identity matrix. We test that the trace tom row is zero
We check that the norm of the residual is less than <code class="docutils literal notranslate"><span class="pre">tol</span> <span class="pre">*</span> <span class="pre">eps</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>isskew, isskewa</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transformsNd.skew">
<code class="sig-prename descclassname">spatialmath.base.transformsNd.</code><code class="sig-name descname">skew</code><span class="sig-paren">(</span><em class="sig-param">v</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transformsNd.html#skew"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transformsNd.skew" title="Permalink to this definition">¶</a></dt>
<dd><p>Create skew-symmetric metrix from vector</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>v</strong> (<em>array_like</em>) – 1- or 3-vector</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>skew-symmetric matrix in so(2) or so(3)</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(2,2) or (3,3)</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>ValueError</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">skew(V)</span></code> is a skew-symmetric matrix formed from the elements of <code class="docutils literal notranslate"><span class="pre">V</span></code>.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">len(V)</span></code>  is 1 then <code class="docutils literal notranslate"><span class="pre">S</span></code> = <span class="math notranslate nohighlight">\(\left[ \begin{array}{cc} 0 &amp; -v \\ v &amp; 0 \end{array} \right]\)</span></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">len(V)</span></code> is 3 then <code class="docutils literal notranslate"><span class="pre">S</span></code> = <span class="math notranslate nohighlight">\(\left[ \begin{array}{ccc} 0 &amp; -v_z &amp; v_y \\ v_z &amp; 0 &amp; -v_x \\ -v_y &amp; v_x &amp; 0\end{array} \right]\)</span></p></li>
</ul>
<p>Notes:</p>
<ul class="simple">
<li><p>This is the inverse of the function <code class="docutils literal notranslate"><span class="pre">vex()</span></code>.</p></li>
<li><p>These are the generator matrices for the Lie algebras so(2) and so(3).</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>vex, skewa</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transformsNd.vex">
<code class="sig-prename descclassname">spatialmath.base.transformsNd.</code><code class="sig-name descname">vex</code><span class="sig-paren">(</span><em class="sig-param">s</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transformsNd.html#vex"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transformsNd.vex" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert skew-symmetric matrix to vector</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>s</strong> (<em>numpy.ndarray</em><em>, </em><em>shape=</em><em>(</em><em>2</em><em>,</em><em>2</em><em>) or </em><em>(</em><em>3</em><em>,</em><em>3</em><em>)</em>) – skew-symmetric matrix</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>vector of unique values</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(1,) or (3,)</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>ValueError</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">vex(S)</span></code> is the vector which has the corresponding skew-symmetric matrix <code class="docutils literal notranslate"><span class="pre">S</span></code>.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">S</span></code> is 2x2 - so(2) case - where <code class="docutils literal notranslate"><span class="pre">S</span></code> <span class="math notranslate nohighlight">\(= \left[ \begin{array}{cc} 0 &amp; -v \\ v &amp; 0 \end{array} \right]\)</span> then return <span class="math notranslate nohighlight">\([v]\)</span></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">S</span></code> is 3x3 - so(3) case -  where <code class="docutils literal notranslate"><span class="pre">S</span></code> <span class="math notranslate nohighlight">\(= \left[ \begin{array}{ccc} 0 &amp; -v_z &amp; v_y \\ v_z &amp; 0 &amp; -v_x \\ -v_y &amp; v_x &amp; 0\end{array} \right]\)</span> then return <span class="math notranslate nohighlight">\([v_x, v_y, v_z]\)</span>.</p></li>
</ul>
<p>Notes:</p>
<ul class="simple">
<li><p>This is the inverse of the function <code class="docutils literal notranslate"><span class="pre">skew()</span></code>.</p></li>
<li><p>Only rudimentary checking (zero diagonal) is done to ensure that the matrix
is actually skew-symmetric.</p></li>
<li><p>The function takes the mean of the two elements that correspond to each unique
element of the matrix.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>skew, vexa</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transformsNd.skewa">
<code class="sig-prename descclassname">spatialmath.base.transformsNd.</code><code class="sig-name descname">skewa</code><span class="sig-paren">(</span><em class="sig-param">v</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transformsNd.html#skewa"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transformsNd.skewa" title="Permalink to this definition">¶</a></dt>
<dd><p>Create augmented skew-symmetric metrix from vector</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>v</strong> (<em>array_like</em>) – 3- or 6-vector</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>augmented skew-symmetric matrix in se(2) or se(3)</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(3,3) or (4,4)</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>ValueError</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">skewa(V)</span></code> is an augmented skew-symmetric matrix formed from the elements of <code class="docutils literal notranslate"><span class="pre">V</span></code>.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">len(V)</span></code> is 3 then S = <span class="math notranslate nohighlight">\(\left[ \begin{array}{ccc} 0 &amp; -v_3 &amp; v_1 \\ v_3 &amp; 0 &amp; v_2 \\ 0 &amp; 0 &amp; 0 \end{array} \right]\)</span></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">len(V)</span></code> is 6 then S = <span class="math notranslate nohighlight">\(\left[ \begin{array}{cccc} 0 &amp; -v_6 &amp; v_5 &amp; v_1 \\ v_6 &amp; 0 &amp; -v_4 &amp; v_2 \\ -v_5 &amp; v_4 &amp; 0 &amp; v_3 \\ 0 &amp; 0 &amp; 0 &amp; 0 \end{array} \right]\)</span></p></li>
</ul>
<p>Notes:</p>
<ul class="simple">
<li><p>This is the inverse of the function <code class="docutils literal notranslate"><span class="pre">vexa()</span></code>.</p></li>
<li><p>These are the generator matrices for the Lie algebras se(2) and se(3).</p></li>
<li><p>Map twist vectors in 2D and 3D space to se(2) and se(3).</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>vexa, skew</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transformsNd.vexa">
<code class="sig-prename descclassname">spatialmath.base.transformsNd.</code><code class="sig-name descname">vexa</code><span class="sig-paren">(</span><em class="sig-param">Omega</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transformsNd.html#vexa"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transformsNd.vexa" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert skew-symmetric matrix to vector</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>s</strong> (<em>numpy.ndarray</em><em>, </em><em>shape=</em><em>(</em><em>3</em><em>,</em><em>3</em><em>) or </em><em>(</em><em>4</em><em>,</em><em>4</em><em>)</em>) – augmented skew-symmetric matrix</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>vector of unique values</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(3,) or (6,)</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>ValueError</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">vex(S)</span></code> is the vector which has the corresponding skew-symmetric matrix <code class="docutils literal notranslate"><span class="pre">S</span></code>.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">S</span></code> is 3x3 - se(2) case - where <code class="docutils literal notranslate"><span class="pre">S</span></code> <span class="math notranslate nohighlight">\(= \left[ \begin{array}{ccc} 0 &amp; -v_3 &amp; v_1 \\ v_3 &amp; 0 &amp; v_2 \\ 0 &amp; 0 &amp; 0 \end{array} \right]\)</span> then return <span class="math notranslate nohighlight">\([v_1, v_2, v_3]\)</span>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">S</span></code> is 4x4 - se(3) case -  where <code class="docutils literal notranslate"><span class="pre">S</span></code> <span class="math notranslate nohighlight">\(= \left[ \begin{array}{cccc} 0 &amp; -v_6 &amp; v_5 &amp; v_1 \\ v_6 &amp; 0 &amp; -v_4 &amp; v_2 \\ -v_5 &amp; v_4 &amp; 0 &amp; v_3 \\ 0 &amp; 0 &amp; 0 &amp; 0 \end{array} \right]\)</span> then return <span class="math notranslate nohighlight">\([v_1, v_2, v_3, v_4, v_5, v_6]\)</span>.</p></li>
</ul>
<p>Notes:</p>
<ul class="simple">
<li><p>This is the inverse of the function <code class="docutils literal notranslate"><span class="pre">skewa</span></code>.</p></li>
<li><p>Only rudimentary checking (zero diagonal) is done to ensure that the matrix
is actually skew-symmetric.</p></li>
<li><p>The function takes the mean of the two elements that correspond to each unique
element of the matrix.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>skewa, vex</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transformsNd.h2e">
<code class="sig-prename descclassname">spatialmath.base.transformsNd.</code><code class="sig-name descname">h2e</code><span class="sig-paren">(</span><em class="sig-param">v</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transformsNd.html#h2e"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transformsNd.h2e" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert from homogeneous to Euclidean form</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>v</strong> (<em>array_like</em>) – homogeneous vector or matrix</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Euclidean vector</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray</p>
</dd>
</dl>
<ul class="simple">
<li><p>If <code class="docutils literal notranslate"><span class="pre">v</span></code> is an array, shape=(N,), return an array shape=(N-1,) where the elements have
all been scaled by the last element of <code class="docutils literal notranslate"><span class="pre">v</span></code>.</p></li>
<li><p>If <code class="docutils literal notranslate"><span class="pre">v</span></code> is a matrix, shape=(N,M), return a matrix shape=(N-1,N), where each column has
been scaled by its last element.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>e2h</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.transformsNd.e2h">
<code class="sig-prename descclassname">spatialmath.base.transformsNd.</code><code class="sig-name descname">e2h</code><span class="sig-paren">(</span><em class="sig-param">v</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/transformsNd.html#e2h"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.transformsNd.e2h" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert from Euclidean to homogeneous form</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>v</strong> (<em>array_like</em>) – Euclidean vector or matrix</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>homogeneous vector</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray</p>
</dd>
</dl>
<ul class="simple">
<li><p>If <code class="docutils literal notranslate"><span class="pre">v</span></code> is an array, shape=(N,), return an array shape=(N+1,) where a value of 1 has
been appended</p></li>
<li><p>If <code class="docutils literal notranslate"><span class="pre">v</span></code> is a matrix, shape=(N,M), return a matrix shape=(N+1,N), where each column has
been appended with a value of 1, ie. a row of ones has been appended to the matrix.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>e2h</p>
</dd>
</dl>
</dd></dl>

</div>
<div class="section" id="module-spatialmath.base.vectors">
<span id="vectors"></span><h3>Vectors<a class="headerlink" href="#module-spatialmath.base.vectors" title="Permalink to this headline">¶</a></h3>
<p>This modules contains functions to create and transform rotation matrices
and homogeneous tranformation matrices.</p>
<p>Vector arguments are what numpy refers to as <code class="docutils literal notranslate"><span class="pre">array_like</span></code> and can be a list,
tuple, numpy array, numpy row vector or numpy column vector.</p>
<dl class="function">
<dt id="spatialmath.base.vectors.colvec">
<code class="sig-prename descclassname">spatialmath.base.vectors.</code><code class="sig-name descname">colvec</code><span class="sig-paren">(</span><em class="sig-param">v</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/vectors.html#colvec"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.vectors.colvec" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="spatialmath.base.vectors.unitvec">
<code class="sig-prename descclassname">spatialmath.base.vectors.</code><code class="sig-name descname">unitvec</code><span class="sig-paren">(</span><em class="sig-param">v</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/vectors.html#unitvec"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.vectors.unitvec" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a unit vector</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>v</strong> (<em>array_like</em>) – n-dimensional vector</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>a unit-vector parallel to V.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>ValueError</strong> – for zero length vector</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">unitvec(v)</span></code> is a vector parallel to <cite>v</cite> of unit length.</p>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>norm</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.vectors.norm">
<code class="sig-prename descclassname">spatialmath.base.vectors.</code><code class="sig-name descname">norm</code><span class="sig-paren">(</span><em class="sig-param">v</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/vectors.html#norm"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.vectors.norm" title="Permalink to this definition">¶</a></dt>
<dd><p>Norm of vector</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>v</strong> – n-vector as a list, dict, or a numpy array, row or column vector</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>norm of vector</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>float</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">norm(v)</span></code> is the 2-norm (length or magnitude) of the vector <code class="docutils literal notranslate"><span class="pre">v</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>unit</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.vectors.isunitvec">
<code class="sig-prename descclassname">spatialmath.base.vectors.</code><code class="sig-name descname">isunitvec</code><span class="sig-paren">(</span><em class="sig-param">v</em>, <em class="sig-param">tol=10</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/vectors.html#isunitvec"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.vectors.isunitvec" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if vector has unit length</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>v</strong> (<em>numpy.ndarray</em>) – vector to test</p></li>
<li><p><strong>tol</strong> (<em>float</em>) – tolerance in units of eps</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>whether vector has unit length</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
<dt class="field-even">Seealso</dt>
<dd class="field-even"><p>unit, isunittwist</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.vectors.iszerovec">
<code class="sig-prename descclassname">spatialmath.base.vectors.</code><code class="sig-name descname">iszerovec</code><span class="sig-paren">(</span><em class="sig-param">v</em>, <em class="sig-param">tol=10</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/vectors.html#iszerovec"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.vectors.iszerovec" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if vector has zero length</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>v</strong> (<em>numpy.ndarray</em>) – vector to test</p></li>
<li><p><strong>tol</strong> (<em>float</em>) – tolerance in units of eps</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>whether vector has zero length</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
<dt class="field-even">Seealso</dt>
<dd class="field-even"><p>unit, isunittwist</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.vectors.isunittwist">
<code class="sig-prename descclassname">spatialmath.base.vectors.</code><code class="sig-name descname">isunittwist</code><span class="sig-paren">(</span><em class="sig-param">v</em>, <em class="sig-param">tol=10</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/vectors.html#isunittwist"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.vectors.isunittwist" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if vector represents a unit twist in SE(2) or SE(3)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>v</strong> (<em>array_like</em>) – vector to test</p></li>
<li><p><strong>tol</strong> (<em>float</em>) – tolerance in units of eps</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>whether vector has unit length</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
<p>Vector is is intepretted as <span class="math notranslate nohighlight">\([v, \omega]\)</span> where <span class="math notranslate nohighlight">\(v \in \mathbb{R}^n\)</span> and
<span class="math notranslate nohighlight">\(\omega \in \mathbb{R}^1\)</span> for SE(2) and <span class="math notranslate nohighlight">\(\omega \in \mathbb{R}^3\)</span> for SE(3).</p>
<p>A unit twist can be a:</p>
<ul class="simple">
<li><p>unit rotational twist where <span class="math notranslate nohighlight">\(|| \omega || = 1\)</span>, or</p></li>
<li><p>unit translational twist where <span class="math notranslate nohighlight">\(|| \omega || = 0\)</span> and <span class="math notranslate nohighlight">\(|| v || = 1\)</span>.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>unit, isunitvec</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.vectors.isunittwist2">
<code class="sig-prename descclassname">spatialmath.base.vectors.</code><code class="sig-name descname">isunittwist2</code><span class="sig-paren">(</span><em class="sig-param">v</em>, <em class="sig-param">tol=10</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/vectors.html#isunittwist2"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.vectors.isunittwist2" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if vector represents a unit twist in SE(2) or SE(3)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>v</strong> (<em>array_like</em>) – vector to test</p></li>
<li><p><strong>tol</strong> (<em>float</em>) – tolerance in units of eps</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>whether vector has unit length</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
<p>Vector is is intepretted as <span class="math notranslate nohighlight">\([v, \omega]\)</span> where <span class="math notranslate nohighlight">\(v \in \mathbb{R}^n\)</span> and
<span class="math notranslate nohighlight">\(\omega \in \mathbb{R}^1\)</span> for SE(2) and <span class="math notranslate nohighlight">\(\omega \in \mathbb{R}^3\)</span> for SE(3).</p>
<p>A unit twist can be a:</p>
<ul class="simple">
<li><p>unit rotational twist where <span class="math notranslate nohighlight">\(|| \omega || = 1\)</span>, or</p></li>
<li><p>unit translational twist where <span class="math notranslate nohighlight">\(|| \omega || = 0\)</span> and <span class="math notranslate nohighlight">\(|| v || = 1\)</span>.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>unit, isunitvec</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.vectors.unittwist">
<code class="sig-prename descclassname">spatialmath.base.vectors.</code><code class="sig-name descname">unittwist</code><span class="sig-paren">(</span><em class="sig-param">S</em>, <em class="sig-param">tol=10</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/vectors.html#unittwist"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.vectors.unittwist" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert twist to unit twist</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>S</strong> (<em>array_like</em>) – twist as a 6-vector</p></li>
<li><p><strong>tol</strong> (<em>float</em>) – tolerance in units of eps</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>unit twist and scalar motion</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>np.ndarray, shape=(6,)</p>
</dd>
</dl>
<p>A unit twist is a twist where:</p>
<ul class="simple">
<li><p>the rotation part has unit magnitude</p></li>
<li><p>if the rotational part is zero, then the translational part has unit magnitude</p></li>
</ul>
<p>Returns None if the twist has zero magnitude</p>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.vectors.unittwist_norm">
<code class="sig-prename descclassname">spatialmath.base.vectors.</code><code class="sig-name descname">unittwist_norm</code><span class="sig-paren">(</span><em class="sig-param">S</em>, <em class="sig-param">tol=10</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/vectors.html#unittwist_norm"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.vectors.unittwist_norm" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert twist to unit twist and norm</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>S</strong> (<em>array_like</em>) – twist as a 6-vector</p></li>
<li><p><strong>tol</strong> (<em>float</em>) – tolerance in units of eps</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>unit twist and scalar motion</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>tuple (np.ndarray shape=(6,), theta)</p>
</dd>
</dl>
<p>A unit twist is a twist where:</p>
<ul class="simple">
<li><p>the rotation part has unit magnitude</p></li>
<li><p>if the rotational part is zero, then the translational part has unit magnitude</p></li>
</ul>
<p>Returns (None,None) if the twist has zero magnitude</p>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.vectors.unittwist2">
<code class="sig-prename descclassname">spatialmath.base.vectors.</code><code class="sig-name descname">unittwist2</code><span class="sig-paren">(</span><em class="sig-param">S</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/vectors.html#unittwist2"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.vectors.unittwist2" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert twist to unit twist</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>S</strong> (<em>array_like</em>) – twist as a 3-vector</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>unit twist and scalar motion</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>tuple (unit_twist, theta)</p>
</dd>
</dl>
<p>A unit twist is a twist where:</p>
<ul class="simple">
<li><p>the rotation part has unit magnitude</p></li>
<li><p>if the rotational part is zero, then the translational part has unit magnitude</p></li>
</ul>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.vectors.angdiff">
<code class="sig-prename descclassname">spatialmath.base.vectors.</code><code class="sig-name descname">angdiff</code><span class="sig-paren">(</span><em class="sig-param">a</em>, <em class="sig-param">b</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/vectors.html#angdiff"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.vectors.angdiff" title="Permalink to this definition">¶</a></dt>
<dd><p>Angular difference</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>a</strong> (<em>scalar</em><em> or </em><em>array_like</em>) – angle in radians</p></li>
<li><p><strong>b</strong> (<em>scalar</em><em> or </em><em>array_like</em>) – angle in radians</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>angular difference a-b</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>scalar or array_like</p>
</dd>
</dl>
<ul class="simple">
<li><p>If <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code> are both scalars, the result is scalar</p></li>
<li><p>If <code class="docutils literal notranslate"><span class="pre">a</span></code> is array_like, the result is a vector a[i]-b</p></li>
<li><p>If <code class="docutils literal notranslate"><span class="pre">a</span></code> is array_like, the result is a vector a-b[i]</p></li>
<li><p>If <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code> are both vectors of the same length, the result is a vector a[i]-b[i]</p></li>
</ul>
</dd></dl>

</div>
<div class="section" id="module-spatialmath.base.quaternions">
<span id="quaternions"></span><h3>Quaternions<a class="headerlink" href="#module-spatialmath.base.quaternions" title="Permalink to this headline">¶</a></h3>
<p>Created on Fri Apr 10 14:12:56 2020</p>
<p>&#64;author: Peter Corke</p>
<dl class="function">
<dt id="spatialmath.base.quaternions.eye">
<code class="sig-prename descclassname">spatialmath.base.quaternions.</code><code class="sig-name descname">eye</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/quaternions.html#eye"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.quaternions.eye" title="Permalink to this definition">¶</a></dt>
<dd><p>Create an identity quaternion</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>an identity quaternion</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>numpy.ndarray, shape=(4,)</p>
</dd>
</dl>
<p>Creates an identity quaternion, with the scalar part equal to one, and
a zero vector value.</p>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.quaternions.pure">
<code class="sig-prename descclassname">spatialmath.base.quaternions.</code><code class="sig-name descname">pure</code><span class="sig-paren">(</span><em class="sig-param">v</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/quaternions.html#pure"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.quaternions.pure" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a pure quaternion</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>v</strong> (<em>array_like</em>) – vector from a 3-vector</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>pure quaternion</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(4,)</p>
</dd>
</dl>
<p>Creates a pure quaternion, with a zero scalar value and the vector part
equal to the passed vector value.</p>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.quaternions.qnorm">
<code class="sig-prename descclassname">spatialmath.base.quaternions.</code><code class="sig-name descname">qnorm</code><span class="sig-paren">(</span><em class="sig-param">q</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/quaternions.html#qnorm"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.quaternions.qnorm" title="Permalink to this definition">¶</a></dt>
<dd><p>Norm of a quaternion</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>q</strong> – input quaternion as a 4-vector</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>norm of the quaternion</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>float</p>
</dd>
</dl>
<p>Returns the norm, length or magnitude of the input quaternion which is
<span class="math notranslate nohighlight">\(\sqrt{s^2 + v_x^2 + v_y^2 + v_z^2}\)</span></p>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>unit</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.quaternions.unit">
<code class="sig-prename descclassname">spatialmath.base.quaternions.</code><code class="sig-name descname">unit</code><span class="sig-paren">(</span><em class="sig-param">q</em>, <em class="sig-param">tol=10</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/quaternions.html#unit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.quaternions.unit" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a unit quaternion</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>v</strong> (<em>array_like</em>) – quaterion as a 4-vector</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>a pure quaternion</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(4,)</p>
</dd>
</dl>
<p>Creates a unit quaternion, with unit norm, by scaling the input quaternion.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p>norm</p>
</div>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.quaternions.isunit">
<code class="sig-prename descclassname">spatialmath.base.quaternions.</code><code class="sig-name descname">isunit</code><span class="sig-paren">(</span><em class="sig-param">q</em>, <em class="sig-param">tol=10</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/quaternions.html#isunit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.quaternions.isunit" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if quaternion has unit length</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>v</strong> (<em>array_like</em>) – quaternion as a 4-vector</p></li>
<li><p><strong>tol</strong> (<em>float</em>) – tolerance in units of eps</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>whether quaternion has unit length</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
<dt class="field-even">Seealso</dt>
<dd class="field-even"><p>unit</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.quaternions.isequal">
<code class="sig-prename descclassname">spatialmath.base.quaternions.</code><code class="sig-name descname">isequal</code><span class="sig-paren">(</span><em class="sig-param">q1</em>, <em class="sig-param">q2</em>, <em class="sig-param">tol=100</em>, <em class="sig-param">unitq=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/quaternions.html#isequal"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.quaternions.isequal" title="Permalink to this definition">¶</a></dt>
<dd><p>Test if quaternions are equal</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>q1</strong> (<em>array_like</em>) – quaternion as a 4-vector</p></li>
<li><p><strong>q2</strong> (<em>array_like</em>) – quaternion as a 4-vector</p></li>
<li><p><strong>unitq</strong> (<em>bool</em>) – quaternions are unit quaternions</p></li>
<li><p><strong>tol</strong> (<em>float</em>) – tolerance in units of eps</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>whether quaternion has unit length</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>bool</p>
</dd>
</dl>
<p>Tests if two quaternions are equal.</p>
<p>For unit-quaternions <code class="docutils literal notranslate"><span class="pre">unitq=True</span></code> the double mapping is taken into account,
that is <code class="docutils literal notranslate"><span class="pre">q</span></code> and <code class="docutils literal notranslate"><span class="pre">-q</span></code> represent the same orientation and <code class="docutils literal notranslate"><span class="pre">isequal(q,</span> <span class="pre">-q,</span> <span class="pre">unitq=True)</span></code> will
return <code class="docutils literal notranslate"><span class="pre">True</span></code>.</p>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.quaternions.q2v">
<code class="sig-prename descclassname">spatialmath.base.quaternions.</code><code class="sig-name descname">q2v</code><span class="sig-paren">(</span><em class="sig-param">q</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/quaternions.html#q2v"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.quaternions.q2v" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert unit-quaternion to 3-vector</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>q</strong> – unit-quaternion as a 4-vector</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>a unique 3-vector</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(3,)</p>
</dd>
</dl>
<p>Returns a unique 3-vector representing the input unit-quaternion. The sign
of the scalar part is made positive, if necessary by multiplying the
entire quaternion by -1, then the vector part is taken.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>There is no check that the passed value is a unit-quaternion.</p>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p>v2q</p>
</div>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.quaternions.v2q">
<code class="sig-prename descclassname">spatialmath.base.quaternions.</code><code class="sig-name descname">v2q</code><span class="sig-paren">(</span><em class="sig-param">v</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/quaternions.html#v2q"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.quaternions.v2q" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert 3-vector to unit-quaternion</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>v</strong> (<em>array_like</em>) – vector part of unit quaternion, a 3-vector</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>a unit quaternion</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(4,)</p>
</dd>
</dl>
<p>Returns a unit-quaternion reconsituted from just its vector part.  Assumes
that the scalar part was positive, so <span class="math notranslate nohighlight">\(s = \sqrt{1-||v||}\)</span>.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p>q2v</p>
</div>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.quaternions.qqmul">
<code class="sig-prename descclassname">spatialmath.base.quaternions.</code><code class="sig-name descname">qqmul</code><span class="sig-paren">(</span><em class="sig-param">q1</em>, <em class="sig-param">q2</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/quaternions.html#qqmul"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.quaternions.qqmul" title="Permalink to this definition">¶</a></dt>
<dd><p>Quaternion multiplication</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>q0</strong> (<em>: array_like</em>) – left-hand quaternion as a 4-vector</p></li>
<li><p><strong>q1</strong> (<em>array_like</em>) – right-hand quaternion as a 4-vector</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>quaternion product</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(4,)</p>
</dd>
</dl>
<p>This is the quaternion or Hamilton product.  If both operands are unit-quaternions then
the product will be a unit-quaternion.</p>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>qvmul, inner, vvmul</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.quaternions.inner">
<code class="sig-prename descclassname">spatialmath.base.quaternions.</code><code class="sig-name descname">inner</code><span class="sig-paren">(</span><em class="sig-param">q1</em>, <em class="sig-param">q2</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/quaternions.html#inner"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.quaternions.inner" title="Permalink to this definition">¶</a></dt>
<dd><p>Quaternion innert product</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>q0</strong> (<em>: array_like</em>) – quaternion as a 4-vector</p></li>
<li><p><strong>q1</strong> (<em>array_like</em>) – uaternion as a 4-vector</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>inner product</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(4,)</p>
</dd>
</dl>
<p>This is the inner or dot product of two quaternions, it is the sum of the element-wise
product.</p>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>qvmul</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.quaternions.qvmul">
<code class="sig-prename descclassname">spatialmath.base.quaternions.</code><code class="sig-name descname">qvmul</code><span class="sig-paren">(</span><em class="sig-param">q</em>, <em class="sig-param">v</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/quaternions.html#qvmul"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.quaternions.qvmul" title="Permalink to this definition">¶</a></dt>
<dd><p>Vector rotation</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>q</strong> (<em>array_like</em>) – unit-quaternion as a 4-vector</p></li>
<li><p><strong>v</strong> (<em>list</em><em>, </em><em>tuple</em><em>, </em><em>numpy.ndarray</em>) – 3-vector to be rotated</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>rotated 3-vector</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(3,)</p>
</dd>
</dl>
<p>The vector <cite>v</cite> is rotated about the origin by the SO(3) equivalent of the unit
quaternion.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>There is no check that the passed value is a unit-quaternions.</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>qvmul</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.quaternions.vvmul">
<code class="sig-prename descclassname">spatialmath.base.quaternions.</code><code class="sig-name descname">vvmul</code><span class="sig-paren">(</span><em class="sig-param">qa</em>, <em class="sig-param">qb</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/quaternions.html#vvmul"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.quaternions.vvmul" title="Permalink to this definition">¶</a></dt>
<dd><p>Quaternion multiplication</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>qa</strong> (<em>: array_like</em>) – left-hand quaternion as a 3-vector</p></li>
<li><p><strong>qb</strong> (<em>array_like</em>) – right-hand quaternion as a 3-vector</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>quaternion product</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(3,)</p>
</dd>
</dl>
<p>This is the quaternion or Hamilton product of unit-quaternions defined only
by their vector components.  The product will be a unit-quaternion, defined only
by its vector component.</p>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>qvmul, inner</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.quaternions.pow">
<code class="sig-prename descclassname">spatialmath.base.quaternions.</code><code class="sig-name descname">pow</code><span class="sig-paren">(</span><em class="sig-param">q</em>, <em class="sig-param">power</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/quaternions.html#pow"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.quaternions.pow" title="Permalink to this definition">¶</a></dt>
<dd><p>Raise quaternion to a power</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>q</strong> – quaternion as a 4-vector</p></li>
<li><p><strong>power</strong> (<em>int</em>) – exponent</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>input quaternion raised to the specified power</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(4,)</p>
</dd>
</dl>
<p>Raises a quaternion to the specified power using repeated multiplication.</p>
<p>Notes:</p>
<ul class="simple">
<li><p>power must be an integer</p></li>
<li><p>power can be negative, in which case the conjugate is taken</p></li>
</ul>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.quaternions.conj">
<code class="sig-prename descclassname">spatialmath.base.quaternions.</code><code class="sig-name descname">conj</code><span class="sig-paren">(</span><em class="sig-param">q</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/quaternions.html#conj"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.quaternions.conj" title="Permalink to this definition">¶</a></dt>
<dd><p>Quaternion conjugate</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>q</strong> – quaternion as a 4-vector</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>conjugate of input quaternion</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(4,)</p>
</dd>
</dl>
<p>Conjugate of quaternion, the vector part is negated.</p>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.quaternions.q2r">
<code class="sig-prename descclassname">spatialmath.base.quaternions.</code><code class="sig-name descname">q2r</code><span class="sig-paren">(</span><em class="sig-param">q</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/quaternions.html#q2r"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.quaternions.q2r" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert unit-quaternion to SO(3) rotation matrix</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>q</strong> – unit-quaternion as a 4-vector</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>corresponding SO(3) rotation matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(3,3)</p>
</dd>
</dl>
<p>Returns an SO(3) rotation matrix corresponding to this unit-quaternion.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>There is no check that the passed value is a unit-quaternion.</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>r2q</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.quaternions.r2q">
<code class="sig-prename descclassname">spatialmath.base.quaternions.</code><code class="sig-name descname">r2q</code><span class="sig-paren">(</span><em class="sig-param">R</em>, <em class="sig-param">check=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/quaternions.html#r2q"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.quaternions.r2q" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert SO(3) rotation matrix to unit-quaternion</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>R</strong> (<em>numpy.ndarray</em><em>, </em><em>shape=</em><em>(</em><em>3</em><em>,</em><em>3</em><em>)</em>) – rotation matrix</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>unit-quaternion</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(3,)</p>
</dd>
</dl>
<p>Returns a unit-quaternion corresponding to the input SO(3) rotation matrix.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>There is no check that the passed matrix is a valid rotation matrix.</p>
</div>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>q2r</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.quaternions.slerp">
<code class="sig-prename descclassname">spatialmath.base.quaternions.</code><code class="sig-name descname">slerp</code><span class="sig-paren">(</span><em class="sig-param">q0</em>, <em class="sig-param">q1</em>, <em class="sig-param">s</em>, <em class="sig-param">shortest=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/quaternions.html#slerp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.quaternions.slerp" title="Permalink to this definition">¶</a></dt>
<dd><p>Quaternion conjugate</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>q0</strong> (<em>array_like</em>) – initial unit quaternion as a 4-vector</p></li>
<li><p><strong>q1</strong> (<em>array_like</em>) – final unit quaternion as a 4-vector</p></li>
<li><p><strong>s</strong> (<em>float</em>) – interpolation coefficient in the range [0,1]</p></li>
<li><p><strong>shortest</strong> (<em>bool</em>) – choose shortest distance [default False]</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>interpolated unit-quaternion</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(4,)</p>
</dd>
</dl>
<p>An interpolated quaternion between <code class="docutils literal notranslate"><span class="pre">q0</span></code> when <code class="docutils literal notranslate"><span class="pre">s</span></code> = 0 to <code class="docutils literal notranslate"><span class="pre">q1</span></code> when <code class="docutils literal notranslate"><span class="pre">s</span></code> = 1.</p>
<p>Interpolation is performed on a great circle on a 4D hypersphere. This is
a rotation about a single fixed axis in space which yields the straightest
and shortest path between two points.</p>
<p>For large rotations the path may be the <em>long way around</em> the circle,
the option <code class="docutils literal notranslate"><span class="pre">'shortest'</span></code> ensures always the shortest path.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>There is no check that the passed values are unit-quaternions.</p>
</div>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.quaternions.rand">
<code class="sig-prename descclassname">spatialmath.base.quaternions.</code><code class="sig-name descname">rand</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/quaternions.html#rand"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.quaternions.rand" title="Permalink to this definition">¶</a></dt>
<dd><p>Random unit-quaternion</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>random unit-quaternion</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>numpy.ndarray, shape=(4,)</p>
</dd>
</dl>
<p>Computes a uniformly distributed random unit-quaternion which can be
considered equivalent to a random SO(3) rotation.</p>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.quaternions.matrix">
<code class="sig-prename descclassname">spatialmath.base.quaternions.</code><code class="sig-name descname">matrix</code><span class="sig-paren">(</span><em class="sig-param">q</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/quaternions.html#matrix"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.quaternions.matrix" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert to 4x4 matrix equivalent</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>q</strong> – quaternion as a 4-vector</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>equivalent matrix</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(4,4)</p>
</dd>
</dl>
<p>Hamilton multiplication between two quaternions can be considered as a
matrix-vector product, the left-hand quaternion is represented by an
equivalent 4x4 matrix and the right-hand quaternion as 4x1 column vector.</p>
<dl class="field-list simple">
<dt class="field-odd">Seealso</dt>
<dd class="field-odd"><p>qqmul</p>
</dd>
</dl>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.quaternions.dot">
<code class="sig-prename descclassname">spatialmath.base.quaternions.</code><code class="sig-name descname">dot</code><span class="sig-paren">(</span><em class="sig-param">q</em>, <em class="sig-param">w</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/quaternions.html#dot"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.quaternions.dot" title="Permalink to this definition">¶</a></dt>
<dd><p>Rate of change of unit-quaternion</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>q0</strong> (<em>array_like</em>) – unit-quaternion as a 4-vector</p></li>
<li><p><strong>w</strong> (<em>array_like</em>) – angular velocity in world frame as a 3-vector</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>rate of change of unit quaternion</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(4,)</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">dot(q,</span> <span class="pre">w)</span></code> is the rate of change of the elements of the unit quaternion <code class="docutils literal notranslate"><span class="pre">q</span></code>
which represents the orientation of a body frame with angular velocity <code class="docutils literal notranslate"><span class="pre">w</span></code> in
the world frame.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>There is no check that the passed values are unit-quaternions.</p>
</div>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.quaternions.dotb">
<code class="sig-prename descclassname">spatialmath.base.quaternions.</code><code class="sig-name descname">dotb</code><span class="sig-paren">(</span><em class="sig-param">q</em>, <em class="sig-param">w</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/quaternions.html#dotb"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.quaternions.dotb" title="Permalink to this definition">¶</a></dt>
<dd><p>Rate of change of unit-quaternion</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>q0</strong> (<em>array_like</em>) – unit-quaternion as a 4-vector</p></li>
<li><p><strong>w</strong> (<em>array_like</em>) – angular velocity in body frame as a 3-vector</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>rate of change of unit quaternion</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray, shape=(4,)</p>
</dd>
</dl>
<p><code class="docutils literal notranslate"><span class="pre">dot(q,</span> <span class="pre">w)</span></code> is the rate of change of the elements of the unit quaternion <code class="docutils literal notranslate"><span class="pre">q</span></code>
which represents the orientation of a body frame with angular velocity <code class="docutils literal notranslate"><span class="pre">w</span></code> in
the body frame.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>There is no check that the passed values are unit-quaternions.</p>
</div>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.quaternions.angle">
<code class="sig-prename descclassname">spatialmath.base.quaternions.</code><code class="sig-name descname">angle</code><span class="sig-paren">(</span><em class="sig-param">q1</em>, <em class="sig-param">q2</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/quaternions.html#angle"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.quaternions.angle" title="Permalink to this definition">¶</a></dt>
<dd><p>Angle between two unit-quaternions</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>q0</strong> (<em>array_like</em>) – unit-quaternion as a 4-vector</p></li>
<li><p><strong>q1</strong> (<em>array_like</em>) – unit-quaternion as a 4-vector</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>angle between the rotations [radians]</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>float</p>
</dd>
</dl>
<p>If each of the input quaternions is considered a rotated coordinate
frame, then the angle is the smallest rotation required about a fixed
axis, to rotate the first frame into the second.</p>
<p>References:  Metrics for 3D rotations: comparison and analysis,
Du Q. Huynh, % J.Math Imaging Vis. DOFI 10.1007/s10851-009-0161-2.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>There is no check that the passed values are unit-quaternions.</p>
</div>
</dd></dl>

<dl class="function">
<dt id="spatialmath.base.quaternions.qprint">
<code class="sig-prename descclassname">spatialmath.base.quaternions.</code><code class="sig-name descname">qprint</code><span class="sig-paren">(</span><em class="sig-param">q</em>, <em class="sig-param">delim=('&lt;'</em>, <em class="sig-param">'&gt;')</em>, <em class="sig-param">fmt='%f'</em>, <em class="sig-param">file=&lt;_io.TextIOWrapper name='&lt;stdout&gt;' mode='w' encoding='UTF-8'&gt;</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/spatialmath/base/quaternions.html#qprint"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#spatialmath.base.quaternions.qprint" title="Permalink to this definition">¶</a></dt>
<dd><p>Format a quaternion</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>q</strong> (<em>array_like</em>) – unit-quaternion as a 4-vector</p></li>
<li><p><strong>delim</strong> (<em>list</em><em> or </em><em>tuple of strings</em>) – 2-list of delimeters [default (‘&lt;’, ‘&gt;’)]</p></li>
<li><p><strong>fmt</strong> (<em>str</em>) – printf-style format soecifier [default ‘%f’]</p></li>
<li><p><strong>file</strong> (<em>file object</em>) – destination for formatted string [default sys.stdout]</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>formatted string</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
<p>Format the quaternion in a human-readable form as:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">S</span>  <span class="n">D1</span>  <span class="n">VX</span> <span class="n">VY</span> <span class="n">VZ</span> <span class="n">D2</span>
</pre></div>
</div>
<p>where S, VX, VY, VZ are the quaternion elements, and D1 and D2 are a pair
of delimeters given by <cite>delim</cite>.</p>
<p>By default the string is written to <cite>sys.stdout</cite>.</p>
<p>If <cite>file=None</cite> then a string is returned.</p>
</dd></dl>

</div>
</div>
</div>


          </div>
          
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
<p class="logo">
  <a href="index.html">
    <img class="logo" src="_static/../../../../figs/icon.png" alt="Logo"/>
    
  </a>
</p>



<p class="blurb">Spatial maths and geometry for Python</p>




<p>
<iframe src="https://ghbtns.com/github-btn.html?user=petercorke&repo=spatialmath-python&type=watch&count=true&size=large&v=2"
  allowtransparency="true" frameborder="0" scrolling="0" width="200px" height="35px"></iframe>
</p>





<h3>Navigation</h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Classes and functions</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#pose-classes">Pose classes</a></li>
<li class="toctree-l2"><a class="reference internal" href="#geometry">Geometry</a></li>
<li class="toctree-l2"><a class="reference internal" href="#functions-base">Functions (base)</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="indices.html">Indices</a></li>
</ul>

<div class="relations">
<h3>Related Topics</h3>
<ul>
  <li><a href="index.html">Documentation overview</a><ul>
      <li>Previous: <a href="intro.html" title="previous chapter">Introduction</a></li>
      <li>Next: <a href="indices.html" title="next chapter">Indices</a></li>
  </ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" />
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>$('#searchbox').show(0);</script>








        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="footer">
      &copy;2020, Peter Corke.
      
      |
      Powered by <a href="http://sphinx-doc.org/">Sphinx 2.4.4</a>
      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
      
      |
      <a href="_sources/spatialmath.rst.txt"
          rel="nofollow">Page source</a>
    </div>

    

    
  </body>
</html>